#NEWLINE# def list_nodes( conn = None , call = None ) : #NEWLINE# #INDENT# '\n    Return a list of VMs that are on the provider\n    ' #NEWLINE# if ( call == 'action' ) : #NEWLINE# #INDENT# raise SaltCloudSystemExit ( 'The list_nodes function must be called with -f or --function.' ) #NEWLINE# #UNINDENT# if ( not conn ) : #NEWLINE# #INDENT# conn = get_conn ( ) #NEWLINE# #UNINDENT# ret = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# datacenter_id = get_datacenter_id ( ) #NEWLINE# nodes = conn . list_servers ( datacenter_id = datacenter_id ) #NEWLINE# for item in nodes [ 'items' ] : #NEWLINE# #INDENT# node = { #NEWLINE# #INDENT# 'id' : item [ 'id' ] , #NEWLINE# #UNINDENT# } #NEWLINE# node . update ( item [ 'properties' ] ) #NEWLINE# ret [ node [ 'name' ] ] = node #NEWLINE# #UNINDENT# return ret