diff options
author | Salvatore Orlando <salvatore.orlando@eu.citrix.com> | 2011-02-23 18:52:53 +0000 |
---|---|---|
committer | Tarmac <> | 2011-02-23 18:52:53 +0000 |
commit | 400bbd8c7d56543a5cebad25d078ec0331b07a3c (patch) | |
tree | c39e3cecf64686f1d3ff3e1d8a3bcf8a1f78eef5 | |
parent | dbb77c920c2d8c5891742b9eaca81f2d94ef1a05 (diff) | |
parent | 424a0996693351d92db3b9d866d4e62b9b2ebe5b (diff) | |
download | nova-400bbd8c7d56543a5cebad25d078ec0331b07a3c.tar.gz nova-400bbd8c7d56543a5cebad25d078ec0331b07a3c.tar.xz nova-400bbd8c7d56543a5cebad25d078ec0331b07a3c.zip |
The proposed branch prevents FlatManager from executing network initialisation tasks contained in linux_net.init_host(), which are unnecessary when flat networking is used.
This is achieved as discussed in question #144979 (https://answers.launchpad.net/nova/+question/144979):
1) init_host in FlatManager has been overriden, thus preventing it from calling init_host in NetworkManager.
2) Also, methods related to floating IPs have been overriden in FlatManager in order to raised NotImplementedError.
-rw-r--r-- | nova/network/manager.py | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/nova/network/manager.py b/nova/network/manager.py index c6eba225e..1df193be0 100644 --- a/nova/network/manager.py +++ b/nova/network/manager.py @@ -322,6 +322,16 @@ class FlatManager(NetworkManager): """ timeout_fixed_ips = False + def init_host(self): + """Do any initialization that needs to be run if this is a + standalone service. + """ + #Fix for bug 723298 - do not call init_host on superclass + #Following code has been copied for NetworkManager.init_host + ctxt = context.get_admin_context() + for network in self.db.host_get_networks(ctxt, self.host): + self._on_set_network_host(ctxt, network['id']) + def allocate_fixed_ip(self, context, instance_id, *args, **kwargs): """Gets a fixed ip from the pool.""" # TODO(vish): when this is called by compute, we can associate compute @@ -406,6 +416,22 @@ class FlatManager(NetworkManager): net['dns'] = FLAGS.flat_network_dns self.db.network_update(context, network_id, net) + def allocate_floating_ip(self, context, project_id): + #Fix for bug 723298 + raise NotImplementedError() + + def associate_floating_ip(self, context, floating_address, fixed_address): + #Fix for bug 723298 + raise NotImplementedError() + + def disassociate_floating_ip(self, context, floating_address): + #Fix for bug 723298 + raise NotImplementedError() + + def deallocate_floating_ip(self, context, floating_address): + #Fix for bug 723298 + raise NotImplementedError() + class FlatDHCPManager(FlatManager): """Flat networking with dhcp. |