The only reason to use yaml.load instead of safe_load is if one wants to
load serialized objects. Heat's use case is purely to load basic data
structures such as maps/lists/strings. Fixes bug #
1117820
Change-Id: I4f6cf2ed4e15405f8b296ccaec737a3779c9867d
tpl = json.loads(tmpl_str)
else:
try:
- tpl = yaml.load(tmpl_str)
+ tpl = yaml.safe_load(tmpl_str)
except yaml.scanner.ScannerError as e:
raise ValueError(e)
else:
json_str = key_re.sub(order_key, json_str)
# parse the string as json to a python structure
- tpl = yaml.load(json_str)
+ tpl = yaml.safe_load(json_str)
# dump python structure to yaml
yml = "HeatTemplateFormatVersion: '2012-12-12'\n" + yaml.safe_dump(tpl)