mirror of
https://github.com/ansible/awx.git
synced 2024-10-27 17:55:10 +03:00
fix a confusing error message when extra vars aren't valid JSON/YAML
see: https://github.com/ansible/awx/issues/8359
This commit is contained in:
parent
e6c124962b
commit
0cdcbdfea6
@ -178,6 +178,9 @@ class ResourceOptionsParser(object):
|
|||||||
except Exception:
|
except Exception:
|
||||||
raise argparse.ArgumentTypeError("{} is not valid JSON or YAML".format(v))
|
raise argparse.ArgumentTypeError("{} is not valid JSON or YAML".format(v))
|
||||||
|
|
||||||
|
if not isinstance(parsed, dict):
|
||||||
|
raise argparse.ArgumentTypeError("{} is not valid JSON or YAML".format(v))
|
||||||
|
|
||||||
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)
|
||||||
|
Loading…
Reference in New Issue
Block a user