Merge pull request #27288 from rallytime/do-cleanup

Filter on 'name', not 'id', when listing images
This commit is contained in:
Justin Findlay 2015-09-21 16:37:26 -06:00
commit d96462af48
2 changed files with 11 additions and 9 deletions

View file

@ -46,7 +46,7 @@ Set up an initial profile at ``/etc/salt/cloud.profiles`` or in the
digitalocean-ubuntu:
provider: my-digitalocean-config
image: Ubuntu 14.04 x32
image: 14.04 x64
size: 512MB
location: New York 1
private_networking: True
@ -117,18 +117,20 @@ command:
----------
digital_ocean:
----------
Arch Linux 2013.05 x64:
10.1:
----------
created_at:
2015-01-20T20:04:34Z
distribution:
Arch Linux
FreeBSD
id:
350424
10144573
min_disk_size:
20
name:
Arch Linux 2013.05 x64
10.1
public:
True
slug:
None
...SNIP...
.. note::

View file

@ -135,9 +135,9 @@ def avail_images(call=None):
items = query(method='images', command='?page=' + str(page) + '&per_page=200')
for image in items['images']:
ret[image['id']] = {}
ret[image['name']] = {}
for item in six.iterkeys(image):
ret[image['id']][item] = image[item]
ret[image['name']][item] = image[item]
page += 1
try: