volume list should return a list of dict and not objects

This commit is contained in:
Craig Vyvial 2012-06-05 23:05:05 -05:00
parent 2ff6e1d09e
commit 9535ce2c78

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