From: thierry Date: Mon, 25 Jan 2010 11:00:57 +0000 (+0000) Subject: fix tracker probing X-Git-Tag: foo~209 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=c677395c44b936ed976955794bf0f22c628694c7;p=infrastructure.git fix tracker probing --- diff --git a/scripts/manage-infrastructure.py b/scripts/manage-infrastructure.py index 267510e..84ad9c1 100755 --- a/scripts/manage-infrastructure.py +++ b/scripts/manage-infrastructure.py @@ -27,12 +27,15 @@ class BuildBoxes: @staticmethod def root (box): return "root@%s"%box + def header (self,message): + print "===============",message + def run (self,argv,message): if self.options.dry_run: print 'DRY_RUN:', print " ".join(argv) else: - if message: print "===============",message + if message: self.header(message) subprocess.call(argv) def backquote (self, argv): @@ -45,11 +48,11 @@ class BuildBoxes: def handle_trackers (self): box = self.fqdn (self.testmaster) if self.options.probe: - command=['ssh',self.root(box),"head","-100","'trackers*'"] - self.run(command,"========== Inspecting trackers on %s"%box) + command=['ssh',self.root(box),"head","-100","tracker*"] + self.run(command,"Inspecting trackers on %s"%box) else: - command=['ssh',self.root(box),"rm","-rf","'trackers*'"] - self.run(command,"========== Cleaning up trackers on %s"%box) + command=['ssh',self.root(box),"rm","-rf","tracker*"] + self.run(command,"Cleaning up trackers on %s"%box) def handle_build_box (self,box): if self.options.probe: @@ -59,7 +62,7 @@ class BuildBoxes: else: pids=self.backquote(command) if not pids: - print 'No build process on',box + self.header ('No build process on %s'%box) else: command=['ssh',self.root(box),'ps'] + [ pid for pid in pids.split("\n") if pid] self.run(command,"Active build processes on %s"%box) @@ -81,7 +84,7 @@ class BuildBoxes: else: pids=self.backquote(command) if not pids: - print 'No qemu process on',box + self.header ('No qemu process on %s'%box) else: command=['ssh',self.root(box),'ps'] + [ pid for pid in pids.split("\n") if pid] self.run(command,"Active qemu processes on %s"%box)