Removes unnecessary clear of DHCP agents.

DHCP agents are automatically removed with network.

Change-Id: I339e1886e3480d7a73a34d52c7eb3432ab7c1aa8
Closes-Bug: #1831900
This commit is contained in:
Ondrej Duchon 2019-06-06 15:56:11 +02:00
parent 40690f07a4
commit afe0455be7
2 changed files with 0 additions and 17 deletions

View File

@ -282,12 +282,6 @@ class NeutronWrapper(NetworkWrapper):
self.client.delete_pool(pool_id)
def delete_network(self, network):
if self.supports_extension("dhcp_agent_scheduler")[0]:
net_dhcps = self.client.list_dhcp_agent_hosting_networks(
network["id"])["agents"]
for net_dhcp in net_dhcps:
self.client.remove_network_from_dhcp_agent(net_dhcp["id"],
network["id"])
if network["router_id"]:
self.client.remove_gateway_router(network["router_id"])

View File

@ -278,9 +278,6 @@ class NeutronWrapperTestCase(test.TestCase):
"lb_pools": []})
self.assertEqual("foo_deleted", result)
self.assertEqual(
service.client.remove_network_from_dhcp_agent.mock_calls,
[mock.call(agent_id, "foo_id") for agent_id in agents])
self.assertEqual(service.client.remove_gateway_router.mock_calls,
[mock.call("foo_router")])
service.client.delete_port.assert_called_once_with(ports[1]["id"])
@ -290,9 +287,6 @@ class NeutronWrapperTestCase(test.TestCase):
[mock.call(subnet_id) for subnet_id in subnets])
service.client.delete_network.assert_called_once_with("foo_id")
mock_neutron_wrapper_supports_extension.assert_called_once_with(
"dhcp_agent_scheduler")
@ddt.data({"exception_type": neutron_exceptions.NotFound,
"should_raise": False},
{"exception_type": neutron_exceptions.BadRequest,
@ -344,13 +338,8 @@ class NeutronWrapperTestCase(test.TestCase):
[mock.call(subnet_id) for subnet_id in subnets])
service.client.delete_network.assert_called_once_with("foo_id")
self.assertEqual(
service.client.remove_network_from_dhcp_agent.mock_calls,
[mock.call(agent_id, "foo_id") for agent_id in agents])
self.assertEqual(service.client.remove_gateway_router.mock_calls,
[mock.call("foo_router")])
mock_neutron_wrapper_supports_extension.assert_called_once_with(
"dhcp_agent_scheduler")
def test_list_networks(self):
service = self.get_wrapper()