Use safe_load to load yaml
Replad `yaml.load` with `yaml.safe_load`
This commit is contained in:
parent
5c029abac1
commit
8c3bf20a13
3 changed files with 3 additions and 3 deletions
|
@ -355,7 +355,7 @@ def main():
|
|||
elif payload and isinstance(payload, str) and HAS_YAML:
|
||||
try:
|
||||
# Validate YAML/JSON string
|
||||
payload = json.dumps(yaml.load(payload))
|
||||
payload = json.dumps(yaml.safe_load(payload))
|
||||
except Exception as e:
|
||||
module.fail_json(msg='Failed to parse provided JSON/YAML content: %s' % to_text(e), exception=to_text(e), payload=payload)
|
||||
elif rest_type == 'xml' and HAS_LXML_ETREE:
|
||||
|
|
|
@ -201,7 +201,7 @@ def get_collection_from_param_map(module, aos):
|
|||
module.fail_json(msg="Python library Yaml is mandatory to use 'param_map'")
|
||||
|
||||
try:
|
||||
param_map = yaml.load(param_map_json)
|
||||
param_map = yaml.safe_load(param_map_json)
|
||||
except:
|
||||
module.fail_json(msg="Unable to parse param_map information")
|
||||
|
||||
|
|
|
@ -78,7 +78,7 @@ def parse_cli(output, tmpl):
|
|||
except ImportError as exc:
|
||||
raise AnsibleError(str(exc))
|
||||
|
||||
spec = yaml.load(open(tmpl).read())
|
||||
spec = yaml.safe_load(open(tmpl).read())
|
||||
obj = {}
|
||||
|
||||
for name, attrs in iteritems(spec['keys']):
|
||||
|
|
Loading…
Reference in a new issue