Merge "Replaces yaml.load() with yaml.safe_load() for fuel-agent"
This commit is contained in:
commit
92baf4b2d5
|
@ -28,7 +28,7 @@ class Configuration(object):
|
||||||
data = {}
|
data = {}
|
||||||
if os.path.exists(config_file):
|
if os.path.exists(config_file):
|
||||||
with open(config_file) as f:
|
with open(config_file) as f:
|
||||||
data = yaml.load(f)
|
data = yaml.safe_load(f)
|
||||||
else:
|
else:
|
||||||
# TODO(atolochkova): need to add logger
|
# TODO(atolochkova): need to add logger
|
||||||
sys.stderr.write("The config file couldn't be found: {0}"
|
sys.stderr.write("The config file couldn't be found: {0}"
|
||||||
|
|
|
@ -664,7 +664,7 @@ class Nailgun(base.BaseDataDriver):
|
||||||
'.yaml'
|
'.yaml'
|
||||||
metadata_url = urljoin(root_uri, filename)
|
metadata_url = urljoin(root_uri, filename)
|
||||||
try:
|
try:
|
||||||
image_meta = yaml.load(
|
image_meta = yaml.safe_load(
|
||||||
utils.init_http_request(metadata_url).text)
|
utils.init_http_request(metadata_url).text)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
LOG.exception(e)
|
LOG.exception(e)
|
||||||
|
|
|
@ -436,7 +436,7 @@ def parse_release_file(content):
|
||||||
# multivalued field. so we can parse it just like yaml
|
# multivalued field. so we can parse it just like yaml
|
||||||
# and then perform additional transformation for those
|
# and then perform additional transformation for those
|
||||||
# fields (we know which ones are multivalues).
|
# fields (we know which ones are multivalues).
|
||||||
data = yaml.load(content)
|
data = yaml.safe_load(content)
|
||||||
|
|
||||||
for attr, columns in six.iteritems(_multivalued_fields):
|
for attr, columns in six.iteritems(_multivalued_fields):
|
||||||
if attr not in data:
|
if attr not in data:
|
||||||
|
@ -883,7 +883,7 @@ def dump_runtime_uuid(uuid, config):
|
||||||
utils.makedirs_if_not_exists(os.path.dirname(config))
|
utils.makedirs_if_not_exists(os.path.dirname(config))
|
||||||
if os.path.isfile(config):
|
if os.path.isfile(config):
|
||||||
with open(config, 'r') as f:
|
with open(config, 'r') as f:
|
||||||
data = yaml.load(f)
|
data = yaml.safe_load(f)
|
||||||
data['runtime_uuid'] = uuid
|
data['runtime_uuid'] = uuid
|
||||||
LOG.debug('Save runtime_uuid:%s to file: %s', uuid, config)
|
LOG.debug('Save runtime_uuid:%s to file: %s', uuid, config)
|
||||||
with open(config, 'wt') as f:
|
with open(config, 'wt') as f:
|
||||||
|
|
Loading…
Reference in New Issue