summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
authorJustin Santa Barbara <justin@fathomdb.com>2011-03-27 18:48:32 -0700
committerJustin Santa Barbara <justin@fathomdb.com>2011-03-27 18:48:32 -0700
commitb3f8e9fb546c621946563af0908e43cb01c50431 (patch)
tree3c110a55987c4d396fedaed411aeb3d4d0ce27d6 /nova/api
parent5936449d99b852897fddbbb140465db0ad9a330c (diff)
Bunch of style fixes
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/openstack/common.py1
-rw-r--r--nova/api/openstack/extensions.py2
-rw-r--r--nova/api/openstack/incubator/volumes/volume_attachments.py21
-rw-r--r--nova/api/openstack/incubator/volumes/volumes.py13
4 files changed, 20 insertions, 17 deletions
diff --git a/nova/api/openstack/common.py b/nova/api/openstack/common.py
index 4ab6b7a81..75aeb0a5f 100644
--- a/nova/api/openstack/common.py
+++ b/nova/api/openstack/common.py
@@ -26,6 +26,7 @@ from nova import log as logging
LOG = logging.getLogger('common')
+
FLAGS = flags.FLAGS
diff --git a/nova/api/openstack/extensions.py b/nova/api/openstack/extensions.py
index 6a8ce9669..e81ffb3d3 100644
--- a/nova/api/openstack/extensions.py
+++ b/nova/api/openstack/extensions.py
@@ -68,7 +68,7 @@ class ExtensionDescriptor(object):
"""The timestamp when the extension was last updated
e.g. '2011-01-22T13:25:27-06:00'"""
- #NOTE(justinsb): Huh? Isn't this defined by the namespace?
+ #NOTE(justinsb): Not sure of the purpose of this is, vs the XML NS
raise NotImplementedError()
def get_resources(self):
diff --git a/nova/api/openstack/incubator/volumes/volume_attachments.py b/nova/api/openstack/incubator/volumes/volume_attachments.py
index 58a9a727b..93786d1c7 100644
--- a/nova/api/openstack/incubator/volumes/volume_attachments.py
+++ b/nova/api/openstack/incubator/volumes/volume_attachments.py
@@ -29,11 +29,12 @@ from nova.api.openstack import faults
LOG = logging.getLogger("nova.api.volumes")
+
FLAGS = flags.FLAGS
def _translate_detail_view(context, volume):
- """ Maps keys for details view"""
+ """Maps keys for details view"""
d = _translate_summary_view(context, volume)
@@ -43,12 +44,12 @@ def _translate_detail_view(context, volume):
def _translate_summary_view(context, vol):
- """ Maps keys for summary view"""
+ """Maps keys for summary view"""
d = {}
volume_id = vol['id']
- # NOTE(justinsb): We use the volume id as the id of the attachment object
+ #NOTE(justinsb): We use the volume id as the id of the attachment object
d['id'] = volume_id
d['volumeId'] = volume_id
@@ -61,7 +62,7 @@ def _translate_summary_view(context, vol):
class Controller(wsgi.Controller):
- """ The volume attachment API controller for the Openstack API
+ """The volume attachment API controller for the Openstack API
A child resource of the server. Note that we use the volume id
as the ID of the attachment (though this is not guaranteed externally)"""
@@ -80,7 +81,7 @@ class Controller(wsgi.Controller):
super(Controller, self).__init__()
def index(self, req, server_id):
- """ Returns the list of volume attachments for a given instance """
+ """Returns the list of volume attachments for a given instance """
return self._items(req, server_id,
entity_maker=_translate_summary_view)
@@ -102,7 +103,7 @@ class Controller(wsgi.Controller):
return {'volumeAttachment': _translate_detail_view(context, vol)}
def create(self, req, server_id):
- """ Attach a volume to an instance """
+ """Attach a volume to an instance """
context = req.environ['nova.context']
env = self._deserialize(req.body, req.get_content_type())
@@ -130,7 +131,7 @@ class Controller(wsgi.Controller):
attachment['id'] = volume_id
attachment['volumeId'] = volume_id
- # NOTE(justinsb): And now, we have a problem...
+ #NOTE(justinsb): And now, we have a problem...
# The attach is async, so there's a window in which we don't see
# the attachment (until the attachment completes). We could also
# get problems with concurrent requests. I think we need an
@@ -138,15 +139,15 @@ class Controller(wsgi.Controller):
# change.
# For now, we'll probably have to rely on libraries being smart
- # TODO: How do I return "accepted" here??
+ #TODO(justinsb): How do I return "accepted" here?
return {'volumeAttachment': attachment}
def update(self, _req, _server_id, _id):
- """ Update a volume attachment. We don't currently support this."""
+ """Update a volume attachment. We don't currently support this."""
return faults.Fault(exc.HTTPBadRequest())
def delete(self, req, server_id, id):
- """ Detach a volume from an instance """
+ """Detach a volume from an instance """
context = req.environ['nova.context']
volume_id = id
diff --git a/nova/api/openstack/incubator/volumes/volumes.py b/nova/api/openstack/incubator/volumes/volumes.py
index ec3b9a6c8..e122bb465 100644
--- a/nova/api/openstack/incubator/volumes/volumes.py
+++ b/nova/api/openstack/incubator/volumes/volumes.py
@@ -26,11 +26,12 @@ from nova.api.openstack import faults
LOG = logging.getLogger("nova.api.volumes")
+
FLAGS = flags.FLAGS
def _translate_detail_view(context, vol):
- """ Maps keys for details view"""
+ """Maps keys for details view"""
d = _translate_summary_view(context, vol)
@@ -40,7 +41,7 @@ def _translate_detail_view(context, vol):
def _translate_summary_view(_context, vol):
- """ Maps keys for summary view"""
+ """Maps keys for summary view"""
d = {}
instance_id = None
@@ -78,7 +79,7 @@ def _translate_summary_view(_context, vol):
class Controller(wsgi.Controller):
- """ The Volumes API controller for the OpenStack API """
+ """The Volumes API controller for the OpenStack API"""
_serialization_metadata = {
'application/xml': {
@@ -109,7 +110,7 @@ class Controller(wsgi.Controller):
return {'volume': _translate_detail_view(context, vol)}
def delete(self, req, id):
- """ Delete a volume """
+ """Delete a volume """
context = req.environ['nova.context']
LOG.audit(_("Delete volume with id: %s"), id, context=context)
@@ -121,11 +122,11 @@ class Controller(wsgi.Controller):
return exc.HTTPAccepted()
def index(self, req):
- """ Returns a summary list of volumes"""
+ """Returns a summary list of volumes"""
return self._items(req, entity_maker=_translate_summary_view)
def detail(self, req):
- """ Returns a detailed list of volumes """
+ """Returns a detailed list of volumes """
return self._items(req, entity_maker=_translate_detail_view)
def _items(self, req, entity_maker):