Merge pull request #100 from cp16net/volume-dic-not-obj

volume list should return a list of dict and not objects
This commit is contained in:
Michael Basnight 2012-06-05 21:07:11 -07:00
commit 2e10b16c7f

View File

@ -594,8 +594,10 @@ def create_server_list_matcher(server_list):
def create_volumes_list_matcher(volume_list):
# Returns a method which finds a volume from the given list.
def find_volumes(server_id):
return [volume for volume in volume_list if server_id in
[attachment["server_id"] for attachment in volume.attachments]]
return [{'id': volume.id, 'size': volume.size}
for volume in volume_list
if server_id in [attachment["server_id"]
for attachment in volume.attachments]]
return find_volumes