summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2017-06-19 20:15:58 +0000
committerGerrit Code Review <review@openstack.org>2017-06-19 20:15:58 +0000
commitfc4e6098579d7584c62c4aaf7bcc0b05571a9a94 (patch)
tree246545fc60c6bd7d0ed1b3d2af9d401263baa6ec
parenta5809278bfa6bc7d78d9c39b6d5dcdbe4b0c7cef (diff)
parente32ce7cf9499f00f477665cca464978e30e9ea2c (diff)
Merge "Use plain routes list for os-tenant-networks instead of stevedore"
-rw-r--r--nova/api/openstack/compute/routes.py13
-rw-r--r--nova/api/openstack/compute/tenant_networks.py17
-rw-r--r--setup.cfg1
3 files changed, 13 insertions, 18 deletions
diff --git a/nova/api/openstack/compute/routes.py b/nova/api/openstack/compute/routes.py
index 339b325..8f3892c 100644
--- a/nova/api/openstack/compute/routes.py
+++ b/nova/api/openstack/compute/routes.py
@@ -80,6 +80,7 @@ from nova.api.openstack.compute import services
80from nova.api.openstack.compute import shelve 80from nova.api.openstack.compute import shelve
81from nova.api.openstack.compute import simple_tenant_usage 81from nova.api.openstack.compute import simple_tenant_usage
82from nova.api.openstack.compute import suspend_server 82from nova.api.openstack.compute import suspend_server
83from nova.api.openstack.compute import tenant_networks
83from nova.api.openstack.compute import used_limits 84from nova.api.openstack.compute import used_limits
84from nova.api.openstack.compute import virtual_interfaces 85from nova.api.openstack.compute import virtual_interfaces
85from nova.api.openstack import wsgi 86from nova.api.openstack import wsgi
@@ -305,6 +306,10 @@ simple_tenant_usage_controller = functools.partial(_create_controller,
305 simple_tenant_usage.SimpleTenantUsageController, [], []) 306 simple_tenant_usage.SimpleTenantUsageController, [], [])
306 307
307 308
309tenant_networks_controller = functools.partial(_create_controller,
310 tenant_networks.TenantNetworkController, [], [])
311
312
308virtual_interfaces_controller = functools.partial(_create_controller, 313virtual_interfaces_controller = functools.partial(_create_controller,
309 virtual_interfaces.ServerVirtualInterfaceController, [], []) 314 virtual_interfaces.ServerVirtualInterfaceController, [], [])
310 315
@@ -540,6 +545,14 @@ ROUTE_LIST = (
540 ('/os-simple-tenant-usage/{id}', { 545 ('/os-simple-tenant-usage/{id}', {
541 'GET': [simple_tenant_usage_controller, 'show'] 546 'GET': [simple_tenant_usage_controller, 'show']
542 }), 547 }),
548 ('/os-tenant-networks', {
549 'GET': [tenant_networks_controller, 'index'],
550 'POST': [tenant_networks_controller, 'create']
551 }),
552 ('/os-tenant-networks/{id}', {
553 'GET': [tenant_networks_controller, 'show'],
554 'DELETE': [tenant_networks_controller, 'delete']
555 }),
543 ('/os-volumes_boot', { 556 ('/os-volumes_boot', {
544 'GET': [server_controller, 'index'], 557 'GET': [server_controller, 'index'],
545 'POST': [server_controller, 'create'] 558 'POST': [server_controller, 'create']
diff --git a/nova/api/openstack/compute/tenant_networks.py b/nova/api/openstack/compute/tenant_networks.py
index f563119..5a664d1 100644
--- a/nova/api/openstack/compute/tenant_networks.py
+++ b/nova/api/openstack/compute/tenant_networks.py
@@ -37,8 +37,6 @@ from nova import quota
37 37
38CONF = nova.conf.CONF 38CONF = nova.conf.CONF
39 39
40ALIAS = 'os-tenant-networks'
41
42QUOTAS = quota.QUOTAS 40QUOTAS = quota.QUOTAS
43LOG = logging.getLogger(__name__) 41LOG = logging.getLogger(__name__)
44 42
@@ -184,21 +182,6 @@ class TenantNetworkController(wsgi.Controller):
184 return {"network": network_dict(networks[0])} 182 return {"network": network_dict(networks[0])}
185 183
186 184
187class TenantNetworks(extensions.V21APIExtensionBase):
188 """Tenant-based Network Management Extension."""
189
190 name = "OSTenantNetworks"
191 alias = ALIAS
192 version = 1
193
194 def get_resources(self):
195 ext = extensions.ResourceExtension(ALIAS, TenantNetworkController())
196 return [ext]
197
198 def get_controller_extensions(self):
199 return []
200
201
202def _sync_networks(context, project_id, session): 185def _sync_networks(context, project_id, session):
203 ctx = nova_context.RequestContext(user_id=None, project_id=project_id) 186 ctx = nova_context.RequestContext(user_id=None, project_id=project_id)
204 ctx = ctx.elevated() 187 ctx = ctx.elevated()
diff --git a/setup.cfg b/setup.cfg
index 93e6f1b..b275d1f 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -84,7 +84,6 @@ nova.api.v21.extensions =
84 remote_consoles = nova.api.openstack.compute.remote_consoles:RemoteConsoles 84 remote_consoles = nova.api.openstack.compute.remote_consoles:RemoteConsoles
85 security_group_default_rules = nova.api.openstack.compute.security_group_default_rules:SecurityGroupDefaultRules 85 security_group_default_rules = nova.api.openstack.compute.security_group_default_rules:SecurityGroupDefaultRules
86 security_groups = nova.api.openstack.compute.security_groups:SecurityGroups 86 security_groups = nova.api.openstack.compute.security_groups:SecurityGroups
87 tenant_networks = nova.api.openstack.compute.tenant_networks:TenantNetworks
88 versions = nova.api.openstack.compute.versionsV21:Versions 87 versions = nova.api.openstack.compute.versionsV21:Versions
89 volumes = nova.api.openstack.compute.volumes:Volumes 88 volumes = nova.api.openstack.compute.volumes:Volumes
90 89