A simpler version of list_nodes_select

Reuse helper

Related to saltstack/salt#27089 Saltcloud virtualbox provider
This commit is contained in:
LoveIsGrief 2016-01-05 22:04:00 +01:00
parent 13d49278f0
commit 4bcd687d1d

View File

@ -254,22 +254,15 @@ def list_nodes(kwargs=None, call=None):
"private_ips",
"public_ips",
]
machines_full_info = list_nodes_full()
return dict([
(key, dict([
(attribute, value[attribute])
for attribute in attributes
])
)
for key, value in machines_full_info.iteritems()
])
return cloud.list_nodes_select(
list_nodes_full('function'), attributes, call,
)
def list_nodes_select(call=None):
"""
Return a list of the VMs that are on the provider, with select fields
"""
log.info(__opts__)
return cloud.list_nodes_select(
list_nodes_full('function'), __opts__['query.selection'], call,
)