1. ebo
  2. tstat

Commits

Joerg Blank  committed ba5d7c0

Fixed node name parsing in ttop

  • Participants
  • Parent commits a758204
  • Branches default

Comments (0)

Files changed (2)

File README

View file
 single line.
 
 The ttop command shows the distribution of jobs onto the nodes in an
-easy to read (colored) format with one node per line.
+easy to read (colored) format with one node per line. For nice
+sorting ttop expects the node names to be in "name-number[.domain.tld]"
+format.
 
 Run "tstat -h" or "ttop -h" for usage information.
 

File tstat/ttop

View file
 class Host(object):
     def __init__(self, name):
         self.name = name
-        self.id = int(name.split('-')[-1])
+        hid = name.split('-')
+        try:
+            hid[-1] = int(hid[-1].split(".")[0])
+        except ValueError:
+            pass
+        self.id = tuple(hid)
         self.jobs = []
         self.down = False
 
         Color_Support = True
     elif options.color == "no":
         Color_Support = False
-    _main()
+
+    if options.version:
+        _version()
+    else:
+        _main()