Require DHCP to be disabled on external subnets

Change-Id: I598fc3adb68d22e0b2eb0ec0a6091a10cee3e47b
This commit is contained in:
Federico Ressi 2021-06-29 10:39:43 +02:00
parent 92dbb0d709
commit a4ddbcbbee
1 changed files with 7 additions and 9 deletions

View File

@ -48,7 +48,7 @@ class ExternalNetworkStackFixture(heat.HeatStackFixture):
def external_name(self): def external_name(self):
return tobiko.tobiko_config().neutron.external_network 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 _external_network: typing.Optional[NeutronNetworkType] = None
@ -63,19 +63,17 @@ class ExternalNetworkStackFixture(heat.HeatStackFixture):
if not network['subnets']: if not network['subnets']:
LOG.debug(f"Network '{network['id']}' has any subnet") LOG.debug(f"Network '{network['id']}' has any subnet")
continue continue
if subnet_parameters: subnets = neutron.list_subnets(network_id=network['id'],
subnets = neutron.list_subnets(network_id=network['id'], **subnet_parameters)
**subnet_parameters) if not subnets:
if not subnets: LOG.debug(f"Network '{network['id']}' has any valid "
LOG.debug(f"Network '{network['id']}' has any valid " f"subnet: {subnet_parameters}")
f"subnet: {subnet_parameters}") continue
continue
network_dump = json.dumps(network, indent=4, sort_keys=True) network_dump = json.dumps(network, indent=4, sort_keys=True)
LOG.debug(f"Found external network for {self.fixture_name}:\n" LOG.debug(f"Found external network for {self.fixture_name}:\n"
f"{network_dump}") f"{network_dump}")
subnets = neutron.list_subnets(network_id=network['id'])
subnets_dump = json.dumps(subnets, indent=4, sort_keys=True) subnets_dump = json.dumps(subnets, indent=4, sort_keys=True)
LOG.debug(f"External subnets for {self.fixture_name}:\n" LOG.debug(f"External subnets for {self.fixture_name}:\n"
f"{subnets_dump}") f"{subnets_dump}")