mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #37929 from gtmanfred/2016.3
add list_nodes_min to nova driver
This commit is contained in:
commit
9d17f1ce90
2 changed files with 36 additions and 0 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue