mirror of
https://github.com/ansible/awx.git
synced 2026-05-19 23:07:42 -02:30
Merge pull request #8370 from ryanpetrello/fix-bad-extra-vars-warning
fix a confusing error message when extra vars aren't valid JSON/YAML Reviewed-by: https://github.com/apps/softwarefactory-project-zuul
This commit is contained in:
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user