summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
authorAlex Meade <alex.meade@rackspace.com>2011-08-10 11:49:54 -0400
committerAlex Meade <alex.meade@rackspace.com>2011-08-10 11:49:54 -0400
commit2046554bc54a2ebbc9ea681b9f35eef79e0a1c0c (patch)
tree23c2e819e6d8c864a3653700146c95961604c842 /nova/api
parent057449d4f96fd168b2e949b6ce429ce012911bec (diff)
downloadnova-2046554bc54a2ebbc9ea681b9f35eef79e0a1c0c.tar.gz
nova-2046554bc54a2ebbc9ea681b9f35eef79e0a1c0c.tar.xz
nova-2046554bc54a2ebbc9ea681b9f35eef79e0a1c0c.zip
Updated extensions to use the TenantMapper
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/openstack/extensions.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/nova/api/openstack/extensions.py b/nova/api/openstack/extensions.py
index d7edd420c..f733b2d95 100644
--- a/nova/api/openstack/extensions.py
+++ b/nova/api/openstack/extensions.py
@@ -29,6 +29,7 @@ from nova import exception
from nova import flags
from nova import log as logging
from nova import wsgi as base_wsgi
+import nova.api.openstack
from nova.api.openstack import common
from nova.api.openstack import faults
from nova.api.openstack import wsgi
@@ -259,7 +260,7 @@ class ExtensionMiddleware(base_wsgi.Middleware):
ext_mgr = ExtensionManager(FLAGS.osapi_extensions_path)
self.ext_mgr = ext_mgr
- mapper = routes.Mapper()
+ mapper = nova.api.openstack.TenantMapper()
serializer = wsgi.ResponseSerializer(
{'application/xml': ExtensionsXMLSerializer()})
@@ -267,12 +268,16 @@ class ExtensionMiddleware(base_wsgi.Middleware):
for resource in ext_mgr.get_resources():
LOG.debug(_('Extended resource: %s'),
resource.collection)
- mapper.resource(resource.collection, resource.collection,
+ kargs = dict(
controller=wsgi.Resource(
resource.controller, serializer=serializer),
collection=resource.collection_actions,
- member=resource.member_actions,
- parent_resource=resource.parent)
+ member=resource.member_actions)
+
+ if resource.parent:
+ kargs['parent_resource'] = resource.parent
+
+ mapper.resource(resource.collection, resource.collection, **kargs)
# extended actions
action_resources = self._action_ext_resources(application, ext_mgr,