From: thierry Date: Mon, 25 Jan 2010 10:47:08 +0000 (+0000) Subject: improve build listing X-Git-Tag: foo~211 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=f0a64034eda5d420c06f4c02492834b87071b6eb;p=infrastructure.git improve build listing --- diff --git a/scripts/manage-infrastructure.py b/scripts/manage-infrastructure.py index cb34056..267510e 100755 --- a/scripts/manage-infrastructure.py +++ b/scripts/manage-infrastructure.py @@ -54,7 +54,15 @@ class BuildBoxes: def handle_build_box (self,box): if self.options.probe: command=['ssh',self.root(box),'pgrep','build'] - self.run(command,"Listing build processes on %s"%box) + if self.options.dry_run: + self.run(command,None) + else: + pids=self.backquote(command) + if not pids: + print 'No build process on',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) else: self.reboot(box)