All API controllers inherit from wsgi.Controller
Most of the Cinder Public API Controllers inherit from wsgi.Controller, but still some Cinder Public APIs controllers directly inherit from object. So it's necessary to unify all the Cinder Public API Controllers inherit from wsgi.Controller. 1. For code cleanup. 2. When we try to do body valid check in api's put/post method later, we can use the helper function is_valid_body instead of using try...catch block. Change-Id: I88812224e0b182939cfccce63982cb8f95792891 Closes-Bug: #1257198
This commit is contained in:
parent
19a2f99830
commit
3b2842bf2d
@ -138,7 +138,7 @@ def check_host(fn):
|
||||
return wrapped
|
||||
|
||||
|
||||
class HostController(object):
|
||||
class HostController(wsgi.Controller):
|
||||
"""The Hosts API controller for the OpenStack API."""
|
||||
def __init__(self):
|
||||
self.api = volume_api.HostAPI()
|
||||
|
@ -65,7 +65,7 @@ class ServicesUpdateTemplate(xmlutil.TemplateBuilder):
|
||||
return xmlutil.MasterTemplate(root, 1)
|
||||
|
||||
|
||||
class ServiceController(object):
|
||||
class ServiceController(wsgi.Controller):
|
||||
@wsgi.serializers(xml=ServicesIndexTemplate)
|
||||
def index(self, req):
|
||||
"""Return a list of all running services.
|
||||
|
@ -75,7 +75,7 @@ class LimitsTemplate(xmlutil.TemplateBuilder):
|
||||
return xmlutil.MasterTemplate(root, 1, nsmap=limits_nsmap)
|
||||
|
||||
|
||||
class LimitsController(object):
|
||||
class LimitsController(wsgi.Controller):
|
||||
"""Controller for accessing limits in the OpenStack API."""
|
||||
|
||||
@wsgi.serializers(xml=LimitsTemplate)
|
||||
|
@ -24,7 +24,7 @@ from cinder import volume
|
||||
from webob import exc
|
||||
|
||||
|
||||
class Controller(object):
|
||||
class Controller(wsgi.Controller):
|
||||
"""The volume metadata API controller for the OpenStack API."""
|
||||
|
||||
def __init__(self):
|
||||
|
@ -24,7 +24,7 @@ from cinder import volume
|
||||
from webob import exc
|
||||
|
||||
|
||||
class Controller(object):
|
||||
class Controller(wsgi.Controller):
|
||||
"""The volume metadata API controller for the OpenStack API."""
|
||||
|
||||
def __init__(self):
|
||||
|
@ -74,7 +74,7 @@ class LimitsTemplate(xmlutil.TemplateBuilder):
|
||||
return xmlutil.MasterTemplate(root, 1, nsmap=limits_nsmap)
|
||||
|
||||
|
||||
class LimitsController(object):
|
||||
class LimitsController(wsgi.Controller):
|
||||
"""Controller for accessing limits in the OpenStack API."""
|
||||
|
||||
@wsgi.serializers(xml=LimitsTemplate)
|
||||
|
@ -24,7 +24,7 @@ from cinder import volume
|
||||
from webob import exc
|
||||
|
||||
|
||||
class Controller(object):
|
||||
class Controller(wsgi.Controller):
|
||||
"""The volume metadata API controller for the OpenStack API."""
|
||||
|
||||
def __init__(self):
|
||||
|
@ -23,7 +23,7 @@ from cinder import exception
|
||||
from cinder import volume
|
||||
|
||||
|
||||
class Controller(object):
|
||||
class Controller(wsgi.Controller):
|
||||
"""The volume metadata API controller for the OpenStack API."""
|
||||
|
||||
def __init__(self):
|
||||
|
Loading…
Reference in New Issue
Block a user