From 9c250f49fda7d8ef67b65668e62264e0f5755d14 Mon Sep 17 00:00:00 2001 From: Tony Mack Date: Wed, 2 Apr 2008 23:03:48 +0000 Subject: [PATCH] move verbose check here --- qaapi/qa/utils.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/qaapi/qa/utils.py b/qaapi/qa/utils.py index 0e5a5a6..89854e1 100644 --- a/qaapi/qa/utils.py +++ b/qaapi/qa/utils.py @@ -10,8 +10,9 @@ def header(message): print output print >> logfile, output - -def popen(command, fatal=True): +def popen(command, fatal=True, verbose = False): + if verbose: + header(command) (stdin, stdout, stderr) = os.popen3(command) output = stdout.readlines() print >> logfile, "+ "+command @@ -24,12 +25,16 @@ def popen(command, fatal=True): raise Exception, "".join(errors) return (output, errors) -def popen3(command): +def popen3(command, verbose = False): + if verbose: + header(command) (stdin, stdout, stderr) = os.popen3(command) print >> logfile, "+ "+command return (stdin, stdout, stderr) -def commands(command, fatal = True): +def commands(command, fatal = True, verbose = False): + if verbose: + header(command) (status, output) = getstatusoutput(command) print >> logfile, "+ "+command print >> logfile, output.strip() -- 2.47.0