Merge "Replace yaml.load() with yaml.safe_load()"

This commit is contained in:
Jenkins 2017-01-30 15:30:19 +00:00 committed by Gerrit Code Review
commit 1b8adaafcb
3 changed files with 3 additions and 3 deletions

View File

@ -196,7 +196,7 @@ class YamlUtils(object):
def get_dict(yaml_file):
'''Returns the dictionary representation of the given YAML spec.'''
try:
return yaml.load(open(yaml_file))
return yaml.safe_load(open(yaml_file))
except IOError:
return None

View File

@ -68,7 +68,7 @@ class ToscaAutoscaling(HotResource):
return yaml.nodes.MappingNode(u'tag:yaml.org,2002:map', nodes)
def _handle_nested_template(self, scale_res):
template_dict = yaml.load(HEAT_TEMPLATE_BASE)
template_dict = yaml.safe_load(HEAT_TEMPLATE_BASE)
template_dict['description'] = 'Tacker Scaling template'
template_dict["resources"] = {}
dict_res = OrderedDict()

View File

@ -214,7 +214,7 @@ class TranslatorShell(object):
msg = _('Deploy the generated template, the stack name is %(name)s.')\
% {'name': heat_stack_name}
log.debug(msg)
tpl = yaml.load(translator.translate())
tpl = yaml.safe_load(translator.translate())
# get all the values for get_file from a translated template
get_files = []