From 628f6e0d10fc59845867833e8a75ff29fbe4e84a Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Thu, 20 Nov 2008 13:04:45 +0000 Subject: [PATCH] cosmetic --- system/TestPlc.py | 10 +++++++++- system/utils.py | 5 ++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/system/TestPlc.py b/system/TestPlc.py index 4a15ab7..2f338cd 100644 --- a/system/TestPlc.py +++ b/system/TestPlc.py @@ -667,7 +667,15 @@ class TestPlc: if datetime.datetime.now() > graceout: success=utils.system(command) else: - success=os.system(command) + # truly silent, just print out a dot to show we're alive + print '.', + sys.stdout.flush() + command += " 2>/dev/null" + if self.options.dry_run: + print 'dry_run',command + success=0 + else: + success=os.system(command) if success==0: utils.header('Successfully entered root@%s (%s)'%(hostname,message)) # refresh tocheck diff --git a/system/utils.py b/system/utils.py index 75250ef..2859642 100644 --- a/system/utils.py +++ b/system/utils.py @@ -1,5 +1,5 @@ # $Id$ -import time, os, re, glob +import time, os, re, glob, sys from pprint import PrettyPrinter options={} @@ -26,6 +26,9 @@ def system(command,background=False): print 'dry_run:',command return 0 else: + now=time.strftime("%H:%M:%S", time.localtime()) + print "*",now,'--', + sys.stdout.flush() return os.system("set -x; " + command) ### WARNING : this ALWAYS does its job, even in dry_run mode -- 2.47.0