From 0e1dd8457f614807c46bf8390ed8e76de263042f Mon Sep 17 00:00:00 2001 From: ghanshyam Date: Wed, 27 Apr 2016 07:59:23 +0900 Subject: [PATCH] Fix tempest init to update config options tempest init does not write back the updated config options to config file after adding those to parser. Change-Id: Ib68e1d48ec0f36cecf13b083f26075d5a8813b62 --- tempest/cmd/init.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tempest/cmd/init.py b/tempest/cmd/init.py index c2b3ce1121..9a3a4edb94 100644 --- a/tempest/cmd/init.py +++ b/tempest/cmd/init.py @@ -99,7 +99,6 @@ class TempestInit(command.Command): config_parse = moves.configparser.SafeConfigParser() config_parse.optionxform = str with open(conf_path, 'a+') as conf_file: - config_parse.readfp(conf_file) # Set local lock_dir in tempest conf if not config_parse.has_section('oslo_concurrency'): config_parse.add_section('oslo_concurrency') @@ -108,6 +107,7 @@ class TempestInit(command.Command): config_parse.set('DEFAULT', 'log_dir', log_dir) # Set default log filename to tempest.log config_parse.set('DEFAULT', 'log_file', 'tempest.log') + config_parse.write(conf_file) def copy_config(self, etc_dir, config_dir): shutil.copytree(config_dir, etc_dir)