Merge "Fix config parser warning" into stable/train

This commit is contained in:
Zuul 2020-08-27 06:27:48 +00:00 committed by Gerrit Code Review
commit 0a35a60198
1 changed files with 4 additions and 1 deletions

View File

@ -148,7 +148,10 @@ def write_default_ansible_cfg(work_dir,
sio_cfg = StringIO()
sio_cfg.write(override_ansible_cfg)
sio_cfg.seek(0)
config.readfp(sio_cfg)
if sys.version_info[0] < 3:
config.readfp(sio_cfg)
else:
config.read_file(sio_cfg)
sio_cfg.close()
with open(ansible_config_path, 'w') as configfile: