cosmetic
authorThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Tue, 13 Sep 2011 09:40:34 +0000 (11:40 +0200)
committerThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Tue, 13 Sep 2011 09:40:34 +0000 (11:40 +0200)
scripts/manage-infrastructure.py

index c6251d6..4199e6e 100755 (executable)
@@ -5,7 +5,7 @@ import re
 import subprocess
 from optparse import OptionParser
 
-class BuildBoxes:
+class Infrastructure:
 
     # everything in the onelab.eu domain
     domain = 'pl.sophia.inria.fr'
@@ -29,7 +29,7 @@ class BuildBoxes:
     def refresh_cache (self):
         retrieved= \
             self.backquote_ssh(self.fqdn(self.testmaster),['LocalTestResources.py'],trash_err=True)
-        remove="."+BuildBoxes.domain
+        remove="."+Infrastructure.domain
         retrieved = [ x.replace(remove,"").strip() for x in retrieved.split()]
         self.qemu_boxes = retrieved
         cache=self.cache_file()
@@ -53,7 +53,7 @@ class BuildBoxes:
 
     @staticmethod
     def ssh(box):
-        return BuildBoxes.ssh_command + [ BuildBoxes.root(box) ]
+        return Infrastructure.ssh_command + [ Infrastructure.root(box) ]
 
     def header (self,message):
         print "===============",message
@@ -110,8 +110,7 @@ class BuildBoxes:
                 if not tracker: continue
                 try:
                     tracker=tracker.strip()
-                    [hostname,buildname]=tracker.split('@')
-                    [left,plcname]=buildname.rsplit('-',1)
+                    (hostname,buildname,plcname)=tracker.split('@')
                     print self.margin_outline(plcname),tracker
                 except:
                     print self.margin(""),tracker
@@ -408,4 +407,4 @@ Default is to act on test boxes only"""
         for box in self.boxes:  self.handle_box (box,"testmaster")
 
 if __name__ == "__main__":
-    BuildBoxes().main()
+    Infrastructure().main()