From a4ddbcbbeec7593ef6f4af738df31295b7e010ec Mon Sep 17 00:00:00 2001 From: Federico Ressi Date: Tue, 29 Jun 2021 10:39:43 +0200 Subject: [PATCH] Require DHCP to be disabled on external subnets Change-Id: I598fc3adb68d22e0b2eb0ec0a6091a10cee3e47b --- tobiko/openstack/stacks/_neutron.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/tobiko/openstack/stacks/_neutron.py b/tobiko/openstack/stacks/_neutron.py index 7dbd96cff..aff44fd80 100644 --- a/tobiko/openstack/stacks/_neutron.py +++ b/tobiko/openstack/stacks/_neutron.py @@ -48,7 +48,7 @@ class ExternalNetworkStackFixture(heat.HeatStackFixture): def external_name(self): return tobiko.tobiko_config().neutron.external_network - subnet_enable_dhcp: typing.Optional[bool] = None + subnet_enable_dhcp: typing.Optional[bool] = False _external_network: typing.Optional[NeutronNetworkType] = None @@ -63,19 +63,17 @@ class ExternalNetworkStackFixture(heat.HeatStackFixture): if not network['subnets']: LOG.debug(f"Network '{network['id']}' has any subnet") continue - if subnet_parameters: - subnets = neutron.list_subnets(network_id=network['id'], - **subnet_parameters) - if not subnets: - LOG.debug(f"Network '{network['id']}' has any valid " - f"subnet: {subnet_parameters}") - continue + subnets = neutron.list_subnets(network_id=network['id'], + **subnet_parameters) + if not subnets: + LOG.debug(f"Network '{network['id']}' has any valid " + f"subnet: {subnet_parameters}") + continue network_dump = json.dumps(network, indent=4, sort_keys=True) LOG.debug(f"Found external network for {self.fixture_name}:\n" f"{network_dump}") - subnets = neutron.list_subnets(network_id=network['id']) subnets_dump = json.dumps(subnets, indent=4, sort_keys=True) LOG.debug(f"External subnets for {self.fixture_name}:\n" f"{subnets_dump}")