#NEWLINE# def list_nodes( full = False , call = None ) : #NEWLINE# #INDENT# '\n    list of nodes, keeping only a brief listing\n\n    CLI Example:\n\n    .. code-block:: bash\n\n        salt-cloud -Q\n    ' #NEWLINE# if ( call == 'action' ) : #NEWLINE# #INDENT# raise SaltCloudSystemExit ( 'The list_nodes function must be called with -f or --function.' ) #NEWLINE# #UNINDENT# ret = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# if POLL_ALL_LOCATIONS : #NEWLINE# #INDENT# for location in JOYENT_LOCATIONS : #NEWLINE# #INDENT# result = query ( command = 'my/machines' , location = location , method = 'GET' ) #NEWLINE# nodes = result [ 1 ] #NEWLINE# for node in nodes : #NEWLINE# #INDENT# if ( 'name' in node ) : #NEWLINE# #INDENT# node [ 'location' ] = location #NEWLINE# ret [ node [ 'name' ] ] = reformat_node ( item = node , full = full ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# result = query ( command = 'my/machines' , location = DEFAULT_LOCATION , method = 'GET' ) #NEWLINE# nodes = result [ 1 ] #NEWLINE# for node in nodes : #NEWLINE# #INDENT# if ( 'name' in node ) : #NEWLINE# #INDENT# node [ 'location' ] = DEFAULT_LOCATION #NEWLINE# ret [ node [ 'name' ] ] = reformat_node ( item = node , full = full ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return ret