Browse Source

Accept external networks withouth DHCP

As we are typically using config-drive for external instances
filtering out nets without dhcp is no
more required

Change-Id: Ifd86046a8fb61372af87c47e6b84d75abcab68dd
changes/59/775159/6
Federico Ressi 6 months ago
parent
commit
7dff8bc3a3
  1. 7
      tobiko/openstack/stacks/_neutron.py
  2. 3
      tobiko/tests/functional/openstack/stacks/test_neutron.py

7
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] = True
subnet_enable_dhcp: typing.Optional[bool] = None
_external_network: typing.Optional[NeutronNetworkType] = None
@ -74,6 +74,11 @@ class ExternalNetworkStackFixture(heat.HeatStackFixture):
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}")
self._external_network = external_network = network
break
else:

3
tobiko/tests/functional/openstack/stacks/test_neutron.py

@ -111,8 +111,7 @@ class ExternalNetworkStackTest(testtools.TestCase):
self.assertTrue(network['id'])
self.assertIs(True, network['router:external'])
self.assertEqual('ACTIVE', network['status'])
subnets = neutron.list_subnets(network_id=network['id'],
enable_dhcp=True)
subnets = neutron.list_subnets(network_id=network['id'])
self.assertNotEqual([], subnets)
def test_has_external_network(self):

Loading…
Cancel
Save