diff options
author | Jenkins <jenkins@review.openstack.org> | 2014-11-22 12:38:48 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2014-11-22 12:38:48 +0000 |
commit | 0c2662bd068b1da0cc60e4b3b2808c8cbf5322ca (patch) | |
tree | 3ebe70bec8825b2598e4cc36729b0f47f9ba8318 | |
parent | 1c025d548f63b613c198f47065bde8cf43655fb3 (diff) | |
parent | 98d3de9f08886950dec4006fdce1b1d467a724d2 (diff) | |
download | os-client-config-0c2662bd068b1da0cc60e4b3b2808c8cbf5322ca.tar.gz |
Merge "Use yaml.safe_load instead of load."
-rw-r--r-- | os_client_config/config.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/os_client_config/config.py b/os_client_config/config.py index ca3a75a..9656f6c 100644 --- a/os_client_config/config.py +++ b/os_client_config/config.py @@ -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 |