Skip to content

Commit

Permalink
All API controllers inherit from wsgi.Controller
Browse files Browse the repository at this point in the history
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
  • Loading branch information
ling-yun committed Dec 4, 2013
1 parent 19a2f99 commit 3b2842b
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion cinder/api/contrib/hosts.py
Expand Up @@ -138,7 +138,7 @@ def wrapped(self, req, id, service=None, *args, **kwargs):
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()
Expand Down
2 changes: 1 addition & 1 deletion cinder/api/contrib/services.py
Expand Up @@ -65,7 +65,7 @@ def construct(self):
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.
Expand Down
2 changes: 1 addition & 1 deletion cinder/api/v1/limits.py
Expand Up @@ -75,7 +75,7 @@ def construct(self):
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)
Expand Down
2 changes: 1 addition & 1 deletion cinder/api/v1/snapshot_metadata.py
Expand Up @@ -24,7 +24,7 @@
from webob import exc


class Controller(object):
class Controller(wsgi.Controller):
"""The volume metadata API controller for the OpenStack API."""

def __init__(self):
Expand Down
2 changes: 1 addition & 1 deletion cinder/api/v1/volume_metadata.py
Expand Up @@ -24,7 +24,7 @@
from webob import exc


class Controller(object):
class Controller(wsgi.Controller):
"""The volume metadata API controller for the OpenStack API."""

def __init__(self):
Expand Down
2 changes: 1 addition & 1 deletion cinder/api/v2/limits.py
Expand Up @@ -74,7 +74,7 @@ def construct(self):
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)
Expand Down
2 changes: 1 addition & 1 deletion cinder/api/v2/snapshot_metadata.py
Expand Up @@ -24,7 +24,7 @@
from webob import exc


class Controller(object):
class Controller(wsgi.Controller):
"""The volume metadata API controller for the OpenStack API."""

def __init__(self):
Expand Down
2 changes: 1 addition & 1 deletion cinder/api/v2/volume_metadata.py
Expand Up @@ -23,7 +23,7 @@
from cinder import volume


class Controller(object):
class Controller(wsgi.Controller):
"""The volume metadata API controller for the OpenStack API."""

def __init__(self):
Expand Down

0 comments on commit 3b2842b

Please sign in to comment.