pep8 fixes

This commit is contained in:
Justin Santa Barbara
2011-03-24 03:28:59 -07:00
parent 230d07e900
commit d49219f8b6
4 changed files with 9 additions and 8 deletions

View File

@@ -141,6 +141,7 @@ class APIRouter(wsgi.Router):
super(APIRouter, self).__init__(mapper)
class APIRouterV10(APIRouter):
"""Define routes specific to OpenStack API V1.0."""

View File

@@ -62,17 +62,17 @@ def _translate_summary_view(context, vol):
class Controller(wsgi.Controller):
""" 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)"""
_serialization_metadata = {
'application/xml': {
'attributes': {
'volumeAttachment': [ 'id',
'serverId',
'volumeId',
'device' ]}}}
'volumeAttachment': ['id',
'serverId',
'volumeId',
'device']}}}
def __init__(self):
self.compute_api = compute.API()

View File

@@ -226,7 +226,7 @@ class TestOpenStackClient(object):
def get_server_volume(self, server_id, attachment_id):
return self.api_get('/servers/%s/volume_attachments/%s' %
(server_id, attachment_id))['volumeAttachment']
def get_server_volumes(self, server_id):
return self.api_get('/servers/%s/volume_attachments' %
(server_id))['volumeAttachments']

View File

@@ -159,8 +159,8 @@ class VolumesTest(integrated_helpers._IntegratedTestBase):
# Template attach request
device = '/dev/sdc'
attach_req = { 'device': device }
post_req = { 'volumeAttachment': attach_req }
attach_req = {'device': device}
post_req = {'volumeAttachment': attach_req}
# Try to attach to a non-existent volume; should fail
attach_req['volumeId'] = 3405691582