Skip to content

Commit

Permalink
Fixed #3. Sorted --all --details output.
Browse files Browse the repository at this point in the history
There are no longer any duplicate machines in --all output. The list of machines is now sorted in alphabetical order for easy viewing of nodes that are going to be in near each other in the DC.
  • Loading branch information
CodyKank committed Sep 15, 2017
1 parent a6f29f7 commit ee3e567
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions node_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -545,16 +545,10 @@ def getAllMachines():
for host in validHosts:
hostMachineList = ((subprocess.getoutput("qconf -shgrp_tree " + str(host))).split())
for element in hostMachineList:
if '@' in element: # If it is a HG name
if element not in processedHGList:
processedHGList.append(element)
readNodes = True # We haven't seen this HG yet, process the nodes
else:
readNodes = False # We've already seen this HG, don't process nodes
elif readNodes:
machineList.append(element)
else: # readNodes == False and '@' not in element(not HG), already counted this node!
continue # We've already seen this node within the hostgroup, don't count it.
if '@' not in element: # If it is not a HG name
if element not in machineList:
machineList.append(element) # Searching whole list for this node
machineList.sort()
return machineList
#^----------------------------------------------------------------------------- getAllMachines()

Expand Down

0 comments on commit ee3e567

Please sign in to comment.