summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2018-09-12 06:59:45 +0000
committerGerrit Code Review <review@openstack.org>2018-09-12 06:59:45 +0000
commitbe267e3c104c6711713d0e6ee112b7cee1bd5987 (patch)
treedbca71d8098dba9ffcd1f533c632e17e793d3d83
parent524b27f87d2e6630ae80a896c33411fba6942cef (diff)
parentdca2fa82efc337d096193a0f1082250f8db2acc6 (diff)
Merge "Fix loading yaml file warning in Python 3"
-rw-r--r--monasca_notification/config.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/monasca_notification/config.py b/monasca_notification/config.py
index 9adee1b..64dd997 100644
--- a/monasca_notification/config.py
+++ b/monasca_notification/config.py
@@ -60,5 +60,6 @@ def parse_args(argv, no_yaml=False):
60def set_from_yaml(): 60def set_from_yaml():
61 if CONF.yaml_config: 61 if CONF.yaml_config:
62 LOG.info('Detected usage of deprecated YAML configuration') 62 LOG.info('Detected usage of deprecated YAML configuration')
63 yaml_cfg = yaml.safe_load(open(CONF.yaml_config, 'rb')) 63 with open(CONF.yaml_config, 'rb') as ycf:
64 yaml_cfg = yaml.safe_load(ycf.read())
64 conf.load_from_yaml(yaml_cfg) 65 conf.load_from_yaml(yaml_cfg)