Fix config file management in tests

This fixes some tests that tried to set options on python3.

Change-Id: Ib2cd36b318b4f8487045c5142fa3c200db61bc79
This commit is contained in:
Thomas Herve 2017-02-01 13:58:13 +01:00 committed by Rico Lin
parent b2421181fb
commit 3a7aee527e

View File

@ -49,7 +49,7 @@ class ReloadOnSighupTest(functional_base.FunctionalTestsBase):
while True:
config.read(self.config_file)
try:
config.set(service, key, value)
config.set(service, key, str(value))
except configparser.NoSectionError:
if retries_count <= 0:
raise
@ -58,7 +58,7 @@ class ReloadOnSighupTest(functional_base.FunctionalTestsBase):
else:
break
with open(self.config_file, 'wb') as f:
with open(self.config_file, 'w') as f:
config.write(f)
def _get_config_value(self, service, key):