Merge pull request #37929 from gtmanfred/2016.3

add list_nodes_min to nova driver
This commit is contained in:
Mike Place 2016-11-28 14:05:39 -07:00 committed by GitHub
commit 9d17f1ce90
2 changed files with 36 additions and 0 deletions

View file

@ -1016,6 +1016,26 @@ def list_nodes_full(call=None, **kwargs):
return ret
def list_nodes_min(call=None, **kwargs):
'''
Return a list of the VMs that in this location
'''
if call == 'action':
raise SaltCloudSystemExit(
(
'The list_nodes_min function must be called with'
' -f or --function.'
)
)
conn = get_conn()
server_list = conn.server_list_min()
if not server_list:
return {}
return server_list
def list_nodes_select(call=None):
'''
Return a list of the VMs that are on the provider, with select fields

View file

@ -771,6 +771,22 @@ class SaltNova(object):
pass
return ret
def server_list_min(self):
'''
List minimal information about servers
'''
nt_ks = self.compute_conn
ret = {}
for item in nt_ks.servers.list(detailed=False):
try:
ret[item.name] = {
'id': item.id,
'status': 'Running'
}
except TypeError:
pass
return ret
def server_list_detailed(self):
'''
Detailed list of servers