From 08e8294f4356e0dc2bc6e034b4e407ac11216d5a Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Fri, 15 Jan 2010 10:36:42 +0000 Subject: [PATCH] fix --- system/TestSlice.py | 2 +- system/utils.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/system/TestSlice.py b/system/TestSlice.py index 2676bc7..0de8d3e 100644 --- a/system/TestSlice.py +++ b/system/TestSlice.py @@ -105,7 +105,7 @@ class TestSlice: date_test_ssh = TestSsh (hostname,key=remote_privatekey,username=self.name()) command = date_test_ssh.actual_command("echo hostname ; hostname; echo id; id; echo uname -a ; uname -a") date = utils.system (command, silent=datetime.datetime.now() < graceout) - if date: + if date==0: utils.header("Successfuly entered slice %s on %s"%(self.name(),hostname)) tocheck.remove(hostname) else: diff --git a/system/utils.py b/system/utils.py index a7637e6..9098b14 100644 --- a/system/utils.py +++ b/system/utils.py @@ -25,7 +25,9 @@ def system(command,background=False,silent=False): print 'dry_run:',command return 0 - if silent : command += " 2> /dev/null" + if silent : + if command.find(';')>=0: command = "(%s) 2> /dev/null" % command + else: command += " 2> /dev/null" if background: command += " &" if silent: print '.', -- 2.43.0