mirror of
https://github.com/ansible/awx.git
synced 2026-05-07 17:37:37 -02:30
Merge pull request #4652 from ryanpetrello/cli-file-load-bug
cli: fix a bug introduced in @ file support Reviewed-by: https://github.com/apps/softwarefactory-project-zuul
This commit is contained in:
@@ -6,6 +6,7 @@ import re
|
|||||||
import yaml
|
import yaml
|
||||||
|
|
||||||
from distutils.util import strtobool
|
from distutils.util import strtobool
|
||||||
|
import six
|
||||||
|
|
||||||
from .custom import CustomAction
|
from .custom import CustomAction
|
||||||
from .format import add_output_formatting_arguments
|
from .format import add_output_formatting_arguments
|
||||||
@@ -146,7 +147,7 @@ class ResourceOptionsParser(object):
|
|||||||
for k, v in parsed.items():
|
for k, v in parsed.items():
|
||||||
# add support for file reading at top-level JSON keys
|
# add support for file reading at top-level JSON keys
|
||||||
# (to make things like SSH key data easier to work with)
|
# (to make things like SSH key data easier to work with)
|
||||||
if v.startswith('@'):
|
if isinstance(v, six.text_type) and v.startswith('@'):
|
||||||
path = os.path.expanduser(v[1:])
|
path = os.path.expanduser(v[1:])
|
||||||
if os.path.exists(path):
|
if os.path.exists(path):
|
||||||
parsed[k] = open(path).read()
|
parsed[k] = open(path).read()
|
||||||
|
|||||||
Reference in New Issue
Block a user