aboutsummaryrefslogtreecommitdiffstats
path: root/functest/opnfv_tests/openstack/tempest/tempest.py
diff options
context:
space:
mode:
authorCédric Ollivier <cedric.ollivier@orange.com>2020-11-27 13:26:46 +0100
committerCédric Ollivier <cedric.ollivier@orange.com>2020-11-27 13:28:33 +0100
commitcf8ab407751f86a998402f2e28e1f4a30ca58872 (patch)
tree0cd677e2f273f06194e50eb64f137516066a4362 /functest/opnfv_tests/openstack/tempest/tempest.py
parentf311d993dd58d24f1610f5abbd6dbbf2deee71eb (diff)
Protect vs false detected external networks if l2-only
Change-Id: I0e58c9df0e9971fcdae5fa7b209940569ae51a78 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com> (cherry picked from commit 3ab6d5693cb303fb73049287e772713a99f84be7)
Diffstat (limited to 'functest/opnfv_tests/openstack/tempest/tempest.py')
-rw-r--r--functest/opnfv_tests/openstack/tempest/tempest.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/functest/opnfv_tests/openstack/tempest/tempest.py b/functest/opnfv_tests/openstack/tempest/tempest.py
index a88f581d9..c9b531282 100644
--- a/functest/opnfv_tests/openstack/tempest/tempest.py
+++ b/functest/opnfv_tests/openstack/tempest/tempest.py
@@ -509,12 +509,14 @@ class TempestCommon(singlevm.VmReady2):
"""Update network section in tempest.conf"""
rconfig = configparser.RawConfigParser()
rconfig.read(self.conf_file)
- if not rconfig.has_section('network'):
- rconfig.add_section('network')
if self.ext_net:
+ if not rconfig.has_section('network'):
+ rconfig.add_section('network')
rconfig.set('network', 'public_network_id', self.ext_net.id)
rconfig.set('network', 'floating_network_name', self.ext_net.name)
else:
+ if not rconfig.has_section('network-feature-enabled'):
+ rconfig.add_section('network-feature-enabled')
rconfig.set('network-feature-enabled', 'floating_ips', False)
with open(self.conf_file, 'w') as config_file:
rconfig.write(config_file)