Use plain routes list for os-tenant-networks instead of stevedore
This patch adds os-tenant-networks related routes by a plain list, instead of using stevedore. After all the Nova API endpoints moves to the plain routes list, the usage of stevedore for API loading will be removed from Nova. Partial-implement-blueprint api-no-more-extensions-pike Change-Id: I54c03a5ec3311677fc095425b71c2b590ff5c987
This commit is contained in:
parent
facfe2ac42
commit
e32ce7cf94
|
@ -80,6 +80,7 @@ from nova.api.openstack.compute import services
|
|||
from nova.api.openstack.compute import shelve
|
||||
from nova.api.openstack.compute import simple_tenant_usage
|
||||
from nova.api.openstack.compute import suspend_server
|
||||
from nova.api.openstack.compute import tenant_networks
|
||||
from nova.api.openstack.compute import used_limits
|
||||
from nova.api.openstack.compute import virtual_interfaces
|
||||
from nova.api.openstack import wsgi
|
||||
|
@ -305,6 +306,10 @@ simple_tenant_usage_controller = functools.partial(_create_controller,
|
|||
simple_tenant_usage.SimpleTenantUsageController, [], [])
|
||||
|
||||
|
||||
tenant_networks_controller = functools.partial(_create_controller,
|
||||
tenant_networks.TenantNetworkController, [], [])
|
||||
|
||||
|
||||
virtual_interfaces_controller = functools.partial(_create_controller,
|
||||
virtual_interfaces.ServerVirtualInterfaceController, [], [])
|
||||
|
||||
|
@ -540,6 +545,14 @@ ROUTE_LIST = (
|
|||
('/os-simple-tenant-usage/{id}', {
|
||||
'GET': [simple_tenant_usage_controller, 'show']
|
||||
}),
|
||||
('/os-tenant-networks', {
|
||||
'GET': [tenant_networks_controller, 'index'],
|
||||
'POST': [tenant_networks_controller, 'create']
|
||||
}),
|
||||
('/os-tenant-networks/{id}', {
|
||||
'GET': [tenant_networks_controller, 'show'],
|
||||
'DELETE': [tenant_networks_controller, 'delete']
|
||||
}),
|
||||
('/os-volumes_boot', {
|
||||
'GET': [server_controller, 'index'],
|
||||
'POST': [server_controller, 'create']
|
||||
|
|
|
@ -37,8 +37,6 @@ from nova import quota
|
|||
|
||||
CONF = nova.conf.CONF
|
||||
|
||||
ALIAS = 'os-tenant-networks'
|
||||
|
||||
QUOTAS = quota.QUOTAS
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
@ -184,21 +182,6 @@ class TenantNetworkController(wsgi.Controller):
|
|||
return {"network": network_dict(networks[0])}
|
||||
|
||||
|
||||
class TenantNetworks(extensions.V21APIExtensionBase):
|
||||
"""Tenant-based Network Management Extension."""
|
||||
|
||||
name = "OSTenantNetworks"
|
||||
alias = ALIAS
|
||||
version = 1
|
||||
|
||||
def get_resources(self):
|
||||
ext = extensions.ResourceExtension(ALIAS, TenantNetworkController())
|
||||
return [ext]
|
||||
|
||||
def get_controller_extensions(self):
|
||||
return []
|
||||
|
||||
|
||||
def _sync_networks(context, project_id, session):
|
||||
ctx = nova_context.RequestContext(user_id=None, project_id=project_id)
|
||||
ctx = ctx.elevated()
|
||||
|
|
|
@ -84,7 +84,6 @@ nova.api.v21.extensions =
|
|||
remote_consoles = nova.api.openstack.compute.remote_consoles:RemoteConsoles
|
||||
security_group_default_rules = nova.api.openstack.compute.security_group_default_rules:SecurityGroupDefaultRules
|
||||
security_groups = nova.api.openstack.compute.security_groups:SecurityGroups
|
||||
tenant_networks = nova.api.openstack.compute.tenant_networks:TenantNetworks
|
||||
versions = nova.api.openstack.compute.versionsV21:Versions
|
||||
volumes = nova.api.openstack.compute.volumes:Volumes
|
||||
|
||||
|
|
Loading…
Reference in New Issue