diff options
| author | Vishvananda Ishaya <vishvananda@gmail.com> | 2012-10-01 10:30:48 -0700 |
|---|---|---|
| committer | Vishvananda Ishaya <vishvananda@gmail.com> | 2012-10-04 09:49:24 -0700 |
| commit | 31764456bd4536c920fb1d768fbdebf93e016a8a (patch) | |
| tree | 1ca740e184677e538e428bb3d7168c0457f0a6f5 /nova/api | |
| parent | b01c148f2fcf68514a276393a6b5a4f79a60f399 (diff) | |
| download | nova-31764456bd4536c920fb1d768fbdebf93e016a8a.tar.gz nova-31764456bd4536c920fb1d768fbdebf93e016a8a.tar.xz nova-31764456bd4536c920fb1d768fbdebf93e016a8a.zip | |
Stop network.api import on network import
The nova.network.__init__.py was importing the network.api
automatically at import time. This was leading to some silly
workarounds (for example in nova/virt/firewall.py) involving
late importing nova.network to stop circular imports.
It is also causing issues with https://review.openstack.org/#/c/13007/
because quantum api needs to import a flag from network manager
which is causing a circular import.
This fixes the issue by moving to use the code from volume_api
which only imports the api class when the method is called. It cleans
up the tests that were stubbing out network.API and also removes
the unneeded workarounds.
Change-Id: I4c9b372d078ab4398e797335a8de5e9e1077e31f
Diffstat (limited to 'nova/api')
| -rw-r--r-- | nova/api/openstack/compute/contrib/networks.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/nova/api/openstack/compute/contrib/networks.py b/nova/api/openstack/compute/contrib/networks.py index f673bf43a..62b4a6c80 100644 --- a/nova/api/openstack/compute/contrib/networks.py +++ b/nova/api/openstack/compute/contrib/networks.py @@ -23,7 +23,7 @@ from webob import exc from nova.api.openstack import extensions from nova import exception from nova import flags -import nova.network.api +from nova import network from nova.openstack.common import log as logging @@ -58,7 +58,7 @@ def network_dict(context, network): class NetworkController(object): def __init__(self, network_api=None): - self.network_api = network_api or nova.network.api.API() + self.network_api = network_api or network.API() def action(self, req, id, body): _actions = { |
