Refine sizes for EC2

This commit is contained in:
Thomas S Hatch 2012-07-15 01:40:10 -06:00
parent f755924627
commit 4e651d5cf0

View File

@ -79,10 +79,11 @@ def avail_images():
images = conn.list_images() images = conn.list_images()
ret = {} ret = {}
for img in images: for img in images:
ret[img.name] = {}
for attr in dir(img): for attr in dir(img):
if attr.startswith('_'): if attr.startswith('_'):
continue continue
ret[attr] = getattr(img, attr) ret[img.name][attr] = getattr(img, attr)
return ret return ret
@ -95,10 +96,11 @@ def avail_sizes():
sizes = conn.list_sizes() sizes = conn.list_sizes()
ret = {} ret = {}
for size in sizes: for size in sizes:
ret[size.name] = {}
for attr in dir(size): for attr in dir(size):
if attr.startswith('_'): if attr.startswith('_'):
continue continue
ret[attr] = getattr(size, attr) ret[size.name][attr] = getattr(size, attr)
return ret return ret