Browse Source

Merge "Fix loading yaml file warning in Python 3"

Zuul 7 months ago
parent
commit
be267e3c10
1 changed files with 2 additions and 1 deletions
  1. 2
    1
      monasca_notification/config.py

+ 2
- 1
monasca_notification/config.py View File

@@ -60,5 +60,6 @@ def parse_args(argv, no_yaml=False):
60 60
 def set_from_yaml():
61 61
     if CONF.yaml_config:
62 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 65
         conf.load_from_yaml(yaml_cfg)

Loading…
Cancel
Save