Merge "Use yaml.safe_load instead of load."

This commit is contained in:
Jenkins 2014-11-22 12:38:48 +00:00 committed by Gerrit Code Review
commit 0c2662bd06

View File

@ -87,12 +87,14 @@ class OpenStackConfig(object):
def _load_config_file(self):
for path in self._config_files:
if os.path.exists(path):
return yaml.load(open(path, 'r'))
with open(path, 'r') as f:
return yaml.safe_load(f)
def _load_vendor_file(self):
for path in self._vendor_files:
if os.path.exists(path):
return yaml.load(open(path, 'r'))
with open(path, 'r') as f:
return yaml.safe_load(f)
def get_cache_max_age(self):
return self._cache_max_age