summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
authorMatthew Hooker <matt@cloudscaling.com>2011-08-10 14:53:53 +0000
committerTarmac <>2011-08-10 14:53:53 +0000
commit651ff375247d3e1b68513a0af607d977a32623c8 (patch)
treee59da9f56e83ffeaab6af536ca6f7d24d118c65d /nova/api
parenta3059b7cce9719d0911191957746b23b581c1511 (diff)
parent83ed9faa488b3ec0f1cb16e7147293c912e2fc2b (diff)
These fixes are the result of trolling the pylint violations here
https://jenkins.openstack.org/job/nova-pylint-errors/violations/
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/openstack/__init__.py9
-rw-r--r--nova/api/openstack/contrib/floating_ips.py2
-rw-r--r--nova/api/openstack/create_instance_helper.py2
-rw-r--r--nova/api/openstack/extensions.py6
4 files changed, 12 insertions, 7 deletions
diff --git a/nova/api/openstack/__init__.py b/nova/api/openstack/__init__.py
index 4d49df2ad..e0c1e9d04 100644
--- a/nova/api/openstack/__init__.py
+++ b/nova/api/openstack/__init__.py
@@ -85,7 +85,10 @@ class APIRouter(base_wsgi.Router):
self._setup_routes(mapper)
super(APIRouter, self).__init__(mapper)
- def _setup_routes(self, mapper, version):
+ def _setup_routes(self, mapper):
+ raise NotImplementedError(_("You must implement _setup_routes."))
+
+ def _setup_base_routes(self, mapper, version):
"""Routes common to all versions."""
server_members = self.server_members
@@ -156,7 +159,7 @@ class APIRouterV10(APIRouter):
"""Define routes specific to OpenStack API V1.0."""
def _setup_routes(self, mapper):
- super(APIRouterV10, self)._setup_routes(mapper, '1.0')
+ self._setup_base_routes(mapper, '1.0')
mapper.resource("shared_ip_group", "shared_ip_groups",
collection={'detail': 'GET'},
@@ -172,7 +175,7 @@ class APIRouterV11(APIRouter):
"""Define routes specific to OpenStack API V1.1."""
def _setup_routes(self, mapper):
- super(APIRouterV11, self)._setup_routes(mapper, '1.1')
+ self._setup_base_routes(mapper, '1.1')
image_metadata_controller = image_metadata.create_resource()
diff --git a/nova/api/openstack/contrib/floating_ips.py b/nova/api/openstack/contrib/floating_ips.py
index 52c9c6cf9..2aba1068a 100644
--- a/nova/api/openstack/contrib/floating_ips.py
+++ b/nova/api/openstack/contrib/floating_ips.py
@@ -102,7 +102,7 @@ class FloatingIPController(object):
def delete(self, req, id):
context = req.environ['nova.context']
ip = self.network_api.get_floating_ip(context, id)
-
+
if 'fixed_ip' in ip:
try:
self.disassociate(req, id, '')
diff --git a/nova/api/openstack/create_instance_helper.py b/nova/api/openstack/create_instance_helper.py
index 894d47beb..1425521a9 100644
--- a/nova/api/openstack/create_instance_helper.py
+++ b/nova/api/openstack/create_instance_helper.py
@@ -14,8 +14,6 @@
# under the License.
import base64
-import re
-import webob
from webob import exc
from xml.dom import minidom
diff --git a/nova/api/openstack/extensions.py b/nova/api/openstack/extensions.py
index 6188e274d..b1538950f 100644
--- a/nova/api/openstack/extensions.py
+++ b/nova/api/openstack/extensions.py
@@ -461,7 +461,11 @@ class ResourceExtension(object):
"""Add top level resources to the OpenStack API in nova."""
def __init__(self, collection, controller, parent=None,
- collection_actions={}, member_actions={}):
+ collection_actions=None, member_actions=None):
+ if not collection_actions:
+ collection_actions = {}
+ if not member_actions:
+ member_actions = {}
self.collection = collection
self.controller = controller
self.parent = parent