summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDobroslaw Zybort <dobroslaw.zybort@ts.fujitsu.com>2018-09-07 10:31:48 +0200
committerDobroslaw Zybort <dobroslaw.zybort@ts.fujitsu.com>2018-09-07 10:31:48 +0200
commitdca2fa82efc337d096193a0f1082250f8db2acc6 (patch)
tree366869f647b3742263b331a1e5cb81a5f79991e5
parentb09885bc284e4534e247f2bdbdad4fde21a7ae93 (diff)
Fix loading yaml file warning in Python 3
Notes
Notes (review): Code-Review+2: Adrian Czarnecki <adrian.czarnecki@ts.fujitsu.com> Workflow+1: Adrian Czarnecki <adrian.czarnecki@ts.fujitsu.com> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Wed, 12 Sep 2018 06:59:45 +0000 Reviewed-on: https://review.openstack.org/600673 Project: openstack/monasca-notification Branch: refs/heads/master
-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)