Fix conf file open mode when "tempest init"

This commit fixes the conf file open mode when "tempest init" command
runs. The original open mode "w" truncates its file. We should use 'a'
for updating a file instead.

Change-Id: I033454950cf58615e212d8c9fdf96765cf45c454
This commit is contained in:
Masayuki Igawa 2016-04-27 06:23:36 +09:00
parent 7242c54914
commit 63cb9a3718

View File

@ -98,7 +98,7 @@ class TempestInit(command.Command):
def update_local_conf(self, conf_path, lock_dir, log_dir):
config_parse = moves.configparser.SafeConfigParser()
config_parse.optionxform = str
with open(conf_path, 'w+') as conf_file:
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'):