mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 01:18:58 +00:00
Adding image_list (and updating flavor_list)
This commit is contained in:
parent
3dd91b4127
commit
28f04d1ca1
@ -38,9 +38,9 @@ def flavor_list():
|
||||
nt = _auth()
|
||||
ret = {}
|
||||
for flavor in nt.flavors.list():
|
||||
links = []
|
||||
links = {}
|
||||
for link in flavor.links:
|
||||
links.append(link['href'])
|
||||
links[link['rel']] = link['href']
|
||||
ret[flavor.name] = {
|
||||
'disk': flavor.disk,
|
||||
'id': flavor.id,
|
||||
@ -143,6 +143,29 @@ def keypair_delete(name):
|
||||
return 'Keypair deleted: {0}'.format(name)
|
||||
|
||||
|
||||
def image_list():
|
||||
'''
|
||||
Return a list of available images (nova images-list)
|
||||
|
||||
CLI Example::
|
||||
|
||||
salt '*' nova.image_list
|
||||
'''
|
||||
nt = _auth()
|
||||
ret = {}
|
||||
for image in nt.images.list():
|
||||
links = {}
|
||||
for link in image.links:
|
||||
links[link['rel']] = link['href']
|
||||
ret[image.name] = {
|
||||
'name': image.name,
|
||||
'id': image.id,
|
||||
'status': image.status,
|
||||
'progress': image.progress,
|
||||
'links': links,
|
||||
}
|
||||
return ret
|
||||
|
||||
def _item_list():
|
||||
'''
|
||||
Template for writing list functions
|
||||
|
Loading…
Reference in New Issue
Block a user