summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2012-02-21 17:16:01 +0000
committerGerrit Code Review <review@openstack.org>2012-02-21 17:16:01 +0000
commit0774865a2f6d92052bfa71bdac9585d24216085a (patch)
tree25deb88a6fb33a7bd242d7a697155e0fd67cbfaa /nova/api
parent13ebb49925c4081b01e1a11f3c3f02eac527d278 (diff)
parentef6c0a270c398e9e1b2a11e92457ddcde30da532 (diff)
Merge "Don't inherit controllers from each other, we don't want the methods of our parent"
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/openstack/compute/contrib/security_groups.py18
1 files changed, 8 insertions, 10 deletions
diff --git a/nova/api/openstack/compute/contrib/security_groups.py b/nova/api/openstack/compute/contrib/security_groups.py
index 0e1b1726d..30d3bd6b6 100644
--- a/nova/api/openstack/compute/contrib/security_groups.py
+++ b/nova/api/openstack/compute/contrib/security_groups.py
@@ -174,12 +174,11 @@ class SecurityGroupRulesXMLDeserializer(wsgi.MetadataXMLDeserializer):
return sg_rule
-class SecurityGroupController(object):
- """The Security group API controller for the OpenStack API."""
+class SecurityGroupControllerBase(object):
+ """Base class for Security Group controllers."""
def __init__(self):
self.compute_api = compute.API()
- super(SecurityGroupController, self).__init__()
self.sgh = utils.import_object(FLAGS.security_group_handler)
def _format_security_group_rule(self, context, rule):
@@ -211,6 +210,10 @@ class SecurityGroupController(object):
context, rule)]
return security_group
+
+class SecurityGroupController(SecurityGroupControllerBase):
+ """The Security group API controller for the OpenStack API."""
+
def _get_security_group(self, context, id):
try:
id = int(id)
@@ -317,7 +320,7 @@ class SecurityGroupController(object):
raise exc.HTTPBadRequest(explanation=msg)
-class SecurityGroupRulesController(SecurityGroupController):
+class SecurityGroupRulesController(SecurityGroupControllerBase):
@wsgi.serializers(xml=SecurityGroupRuleTemplate)
@wsgi.deserializers(xml=SecurityGroupRulesXMLDeserializer)
@@ -509,12 +512,7 @@ class SecurityGroupRulesController(SecurityGroupController):
return webob.Response(status_int=202)
-# NOTE(justinsb): Does WSGI see the base class methods?
-# i.e. are we exposing create/delete here?
-class ServerSecurityGroupController(SecurityGroupController):
- def __init__(self, *args, **kwargs):
- super(ServerSecurityGroupController, self).__init__(*args, **kwargs)
- self.compute_api = compute.API()
+class ServerSecurityGroupController(SecurityGroupControllerBase):
@wsgi.serializers(xml=SecurityGroupsTemplate)
def index(self, req, server_id):