From ec6be8e59e7021939c8a04d64be1c13403291d67 Mon Sep 17 00:00:00 2001 From: Sumit Naiksatam Date: Fri, 9 Mar 2012 21:02:22 -0800 Subject: Bug #922356 QuantumManager does not initiate unplug on the linux_net driver remove_gateway() being added to L3 driver API which gets invoked from QuantumManager when a network is deleted. remove_gateway() implementation for LinuxNetL3 calls unplug on the linux_net driver. Change-Id: I42d12cf8653c61436e89e97eaa384f26ee2ed707 --- nova/network/l3.py | 10 ++++++++++ nova/network/quantum/manager.py | 1 + 2 files changed, 11 insertions(+) (limited to 'nova') diff --git a/nova/network/l3.py b/nova/network/l3.py index 487b07311..4603bdf90 100644 --- a/nova/network/l3.py +++ b/nova/network/l3.py @@ -45,6 +45,10 @@ class L3Driver(object): """Set up a gateway on this network""" raise NotImplementedError() + def remove_gateway(self, network_ref): + """Remove an existing gateway on this network""" + raise NotImplementedError() + def is_initialized(self): """:returns: True/False (whether the driver is initialized)""" raise NotImplementedError() @@ -94,6 +98,9 @@ class LinuxNetL3(L3Driver): gateway=(network_ref['gateway'] is not None)) linux_net.initialize_gateway_device(dev, network_ref) + def remove_gateway(self, network_ref): + linux_net.unplug(network_ref) + def add_floating_ip(self, floating_ip, fixed_ip, l3_interface_id): linux_net.bind_floating_ip(floating_ip, l3_interface_id) linux_net.ensure_floating_forward(floating_ip, fixed_ip) @@ -133,6 +140,9 @@ class NullL3(L3Driver): def initialize_gateway(self, network_ref): pass + def remove_gateway(self, network_ref): + pass + def add_floating_ip(self, floating_ip, fixed_ip, l3_interface_id): pass diff --git a/nova/network/quantum/manager.py b/nova/network/quantum/manager.py index 16e782fa8..eb0f389f7 100644 --- a/nova/network/quantum/manager.py +++ b/nova/network/quantum/manager.py @@ -258,6 +258,7 @@ class QuantumManager(manager.FloatingIP, manager.FlatManager): self.q_conn.detach_and_delete_port(q_tenant_id, net_uuid, gw_port_uuid) + self.l3driver.remove_gateway(net_ref) # Now we can delete the network self.q_conn.delete_network(q_tenant_id, net_uuid) -- cgit