Avoid duplicating tempest section in rally.conf 25/59725/1
authorCédric Ollivier <cedric.ollivier@orange.com>
Thu, 12 Jul 2018 03:34:54 +0000 (05:34 +0200)
committerCédric Ollivier <cedric.ollivier@orange.com>
Thu, 12 Jul 2018 03:36:03 +0000 (05:36 +0200)
Change-Id: I79598cce2c7dfe0a2e969ddd32735c3eb189fa7a
Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
(cherry picked from commit 8b912cec489a96178fcac5667c03e20850149c3a)

functest/opnfv_tests/openstack/tempest/tempest.py

index 818b6cc..23708ca 100644 (file)
@@ -262,7 +262,8 @@ class TempestCommon(singlevm.VmReady1):
         """Set image name as tempest img_name_regex"""
         rconfig = configparser.RawConfigParser()
         rconfig.read(rally_conf)
-        rconfig.add_section('tempest')
+        if not rconfig.has_section('tempest'):
+            rconfig.add_section('tempest')
         rconfig.set('tempest', 'img_name_regex', '^{}$'.format(
             self.image.name))
         with open(rally_conf, 'wb') as config_file: