diff options
| -rw-r--r-- | nova/network/l3.py | 10 | ||||
| -rw-r--r-- | nova/network/quantum/manager.py | 1 |
2 files changed, 11 insertions, 0 deletions
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) |
