Skip to content

Commit a948a80

Browse files
Zuulopenstack-gerrit
authored andcommitted
Merge "nova-net: Remove layer of indirection in 'nova.network'"
2 parents 824bc35 + fadeedc commit a948a80

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+353
-705
lines changed

nova/api/metadata/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
import nova.conf
3333
from nova import context
3434
from nova import exception
35-
from nova import network
35+
from nova.network import neutron
3636
from nova.network.security_group import openstack_driver
3737
from nova import objects
3838
from nova.objects import virt_device_metadata as metadata_obj
@@ -645,7 +645,7 @@ def handle_path(self, path_tokens):
645645

646646
def get_metadata_by_address(address):
647647
ctxt = context.get_admin_context()
648-
fixed_ip = network.API().get_fixed_ip_by_address(ctxt, address)
648+
fixed_ip = neutron.API().get_fixed_ip_by_address(ctxt, address)
649649
LOG.info('Fixed IP %(ip)s translates to instance UUID %(uuid)s',
650650
{'ip': address, 'uuid': fixed_ip['instance_uuid']})
651651

nova/api/metadata/handler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
from nova import context as nova_context
3535
from nova import exception
3636
from nova.i18n import _
37-
from nova.network.neutronv2 import api as neutronapi
37+
from nova.network import neutron as neutronapi
3838

3939
CONF = nova.conf.CONF
4040
LOG = logging.getLogger(__name__)

nova/api/openstack/common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
from nova import context as nova_context
3232
from nova import exception
3333
from nova.i18n import _
34-
from nova.network.neutronv2 import constants
34+
from nova.network import constants
3535
from nova import objects
3636
from nova import quota
3737
from nova import utils

nova/api/openstack/compute/attach_interfaces.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
from nova.compute import api as compute
2727
from nova import exception
2828
from nova.i18n import _
29-
from nova import network
29+
from nova.network import neutron
3030
from nova import objects
3131
from nova.policies import attach_interfaces as ai_policies
3232

@@ -61,7 +61,7 @@ class InterfaceAttachmentController(wsgi.Controller):
6161
def __init__(self):
6262
super(InterfaceAttachmentController, self).__init__()
6363
self.compute_api = compute.API()
64-
self.network_api = network.API()
64+
self.network_api = neutron.API()
6565

6666
@wsgi.expected_errors((404, 501))
6767
def index(self, req, server_id):

nova/api/openstack/compute/evacuate.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
import nova.conf
2626
from nova import exception
2727
from nova.i18n import _
28-
from nova import network
28+
from nova.network import neutron
2929
from nova.policies import evacuate as evac_policies
3030
from nova import utils
3131

@@ -37,7 +37,7 @@ def __init__(self):
3737
super(EvacuateController, self).__init__()
3838
self.compute_api = compute.API()
3939
self.host_api = compute.HostAPI()
40-
self.network_api = network.API()
40+
self.network_api = neutron.API()
4141

4242
def _get_on_shared_storage(self, req, evacuate_body):
4343
if api_version_request.is_supported(req, min_version='2.14'):

nova/api/openstack/compute/floating_ip_pools.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
from nova.api.openstack.api_version_request \
1616
import MAX_PROXY_API_SUPPORT_VERSION
1717
from nova.api.openstack import wsgi
18-
from nova import network
18+
from nova.network import neutron
1919
from nova.policies import floating_ip_pools as fip_policies
2020

2121

@@ -37,7 +37,7 @@ class FloatingIPPoolsController(wsgi.Controller):
3737

3838
def __init__(self):
3939
super(FloatingIPPoolsController, self).__init__()
40-
self.network_api = network.API()
40+
self.network_api = neutron.API()
4141

4242
@wsgi.Controller.api_version("2.1", MAX_PROXY_API_SUPPORT_VERSION)
4343
@wsgi.expected_errors(())

nova/api/openstack/compute/floating_ips.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
from nova.compute import api as compute
3030
from nova import exception
3131
from nova.i18n import _
32-
from nova import network
32+
from nova.network import neutron
3333
from nova.policies import floating_ips as fi_policies
3434

3535

@@ -108,7 +108,7 @@ class FloatingIPController(wsgi.Controller):
108108
def __init__(self):
109109
super(FloatingIPController, self).__init__()
110110
self.compute_api = compute.API()
111-
self.network_api = network.API()
111+
self.network_api = neutron.API()
112112

113113
@wsgi.Controller.api_version("2.1", MAX_PROXY_API_SUPPORT_VERSION)
114114
@wsgi.expected_errors((400, 404))
@@ -207,7 +207,7 @@ class FloatingIPActionController(wsgi.Controller):
207207
def __init__(self):
208208
super(FloatingIPActionController, self).__init__()
209209
self.compute_api = compute.API()
210-
self.network_api = network.API()
210+
self.network_api = neutron.API()
211211

212212
@wsgi.Controller.api_version("2.1", "2.43")
213213
@wsgi.expected_errors((400, 403, 404))

nova/api/openstack/compute/migrate_server.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
from nova.compute import api as compute
2727
from nova import exception
2828
from nova.i18n import _
29-
from nova import network
29+
from nova.network import neutron
3030
from nova import objects
3131
from nova.policies import migrate_server as ms_policies
3232

@@ -39,7 +39,7 @@ class MigrateServerController(wsgi.Controller):
3939
def __init__(self):
4040
super(MigrateServerController, self).__init__()
4141
self.compute_api = compute.API()
42-
self.network_api = network.API()
42+
self.network_api = neutron.API()
4343

4444
@wsgi.response(202)
4545
@wsgi.expected_errors((400, 403, 404, 409))

nova/api/openstack/compute/networks.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
from nova.api.openstack import wsgi
2222
from nova import exception
2323
from nova.i18n import _
24-
from nova import network
24+
from nova.network import neutron
2525
from nova.objects import base as base_obj
2626
from nova.objects import fields as obj_fields
2727
from nova.policies import networks as net_policies
@@ -77,7 +77,7 @@ class NetworkController(wsgi.Controller):
7777
def __init__(self, network_api=None):
7878
super(NetworkController, self).__init__()
7979
# TODO(stephenfin): 'network_api' is only being passed for use by tests
80-
self.network_api = network_api or network.API()
80+
self.network_api = network_api or neutron.API()
8181

8282
@wsgi.Controller.api_version("2.1", MAX_PROXY_API_SUPPORT_VERSION)
8383
@wsgi.expected_errors(())

nova/api/openstack/compute/schemas/servers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@
201201
'type': 'object',
202202
'properties': {
203203
# NOTE(oomichi): allocate_for_instance() of
204-
# neutronv2/api.py gets security_group names
204+
# network/neutron.py gets security_group names
205205
# or UUIDs from this parameter.
206206
# parameter_types.name allows both format.
207207
'name': parameter_types.name,

0 commit comments

Comments
 (0)