From 3ab6d5693cb303fb73049287e772713a99f84be7 Mon Sep 17 00:00:00 2001 From: Cédric Ollivier Date: Fri, 27 Nov 2020 13:26:46 +0100 Subject: Protect vs false detected external networks if l2-only MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I0e58c9df0e9971fcdae5fa7b209940569ae51a78 Signed-off-by: Cédric Ollivier --- functest/opnfv_tests/openstack/tempest/tempest.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'functest/opnfv_tests') diff --git a/functest/opnfv_tests/openstack/tempest/tempest.py b/functest/opnfv_tests/openstack/tempest/tempest.py index fc92a69b0..ed3c4761f 100644 --- a/functest/opnfv_tests/openstack/tempest/tempest.py +++ b/functest/opnfv_tests/openstack/tempest/tempest.py @@ -502,12 +502,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) -- cgit 1.2.3-korg