From f0a64034eda5d420c06f4c02492834b87071b6eb Mon Sep 17 00:00:00 2001 From: thierry Date: Mon, 25 Jan 2010 10:47:08 +0000 Subject: [PATCH] improve build listing --- scripts/manage-infrastructure.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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) -- 2.47.0