From 4e00999e0d246e131c7f777614e2004f62afc3e2 Mon Sep 17 00:00:00 2001 From: He Jie Xu Date: Wed, 20 Dec 2017 12:01:30 +0800 Subject: [PATCH] Remove the inherits parameter for the Resource object In the past, the '/os-volumes_boot' API is inherited from the '/servers' API, then the Resource object have the ability to get method from the inherits controller. But now, we use the plain routes, all the methods of '/os-volumes_boot' are listed in the route list now. Partial implement bp api-extensions-merge-queens Change-Id: Iff44b7756fd9a0f4aa78fa4306e66344011d0c2f --- nova/api/openstack/wsgi.py | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/nova/api/openstack/wsgi.py b/nova/api/openstack/wsgi.py index 200ee7133107..3f7eebc2372a 100644 --- a/nova/api/openstack/wsgi.py +++ b/nova/api/openstack/wsgi.py @@ -438,13 +438,9 @@ class Resource(wsgi.Application): """ support_api_request_version = True - def __init__(self, controller, inherits=None): + def __init__(self, controller): """:param controller: object that implement methods created by routes lib - :param inherits: another resource object that this resource should - inherit extensions from. Any action extensions that - are applied to the parent resource will also apply - to this resource. """ self.controller = controller @@ -459,7 +455,6 @@ class Resource(wsgi.Application): # Save a mapping of extensions self.wsgi_extensions = {} self.wsgi_action_extensions = {} - self.inherits = inherits def register_actions(self, controller): """Registers controller actions with this resource.""" @@ -696,12 +691,6 @@ class Resource(wsgi.Application): action, content_type, body) - if self.inherits: - _meth, parent_ext = self.inherits.get_method(request, - action, - content_type, - body) - extensions.extend(parent_ext) return meth, extensions def _get_method(self, request, action, content_type, body):