Merge "Fix loading yaml file warning in Python 3"

This commit is contained in:
Zuul 2018-09-12 06:59:45 +00:00 committed by Gerrit Code Review
commit be267e3c10

View File

@ -60,5 +60,6 @@ def parse_args(argv, no_yaml=False):
def set_from_yaml(): def set_from_yaml():
if CONF.yaml_config: if CONF.yaml_config:
LOG.info('Detected usage of deprecated YAML configuration') LOG.info('Detected usage of deprecated YAML configuration')
yaml_cfg = yaml.safe_load(open(CONF.yaml_config, 'rb')) with open(CONF.yaml_config, 'rb') as ycf:
yaml_cfg = yaml.safe_load(ycf.read())
conf.load_from_yaml(yaml_cfg) conf.load_from_yaml(yaml_cfg)