git://git.onelab.eu
/
tests.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
ea3973b
)
modify header() to make logging output optional.
author
Tony Mack
<tmack@cs.princeton.edu>
Tue, 8 Apr 2008 18:15:08 +0000
(18:15 +0000)
committer
Tony Mack
<tmack@cs.princeton.edu>
Tue, 8 Apr 2008 18:15:08 +0000
(18:15 +0000)
qaapi/qa/utils.py
patch
|
blob
|
history
diff --git
a/qaapi/qa/utils.py
b/qaapi/qa/utils.py
index
89854e1
..
40eb086
100644
(file)
--- a/
qaapi/qa/utils.py
+++ b/
qaapi/qa/utils.py
@@
-4,15
+4,17
@@
import os
from commands import getstatusoutput
from logger import logfile
from commands import getstatusoutput
from logger import logfile
-def header(message):
+def header(message
, log = True
):
now=time.strftime("%H:%M:%S", time.localtime())
output = "*"+now+'--'+message
print output
now=time.strftime("%H:%M:%S", time.localtime())
output = "*"+now+'--'+message
print output
- print >> logfile, output
+ if log:
+ print >> logfile, output
def popen(command, fatal=True, verbose = False):
def popen(command, fatal=True, verbose = False):
+ header(command)
if verbose:
if verbose:
- header(command
)
+ header(command
, False)
(stdin, stdout, stderr) = os.popen3(command)
output = stdout.readlines()
print >> logfile, "+ "+command
(stdin, stdout, stderr) = os.popen3(command)
output = stdout.readlines()
print >> logfile, "+ "+command
@@
-27,14
+29,14
@@
def popen(command, fatal=True, verbose = False):
def popen3(command, verbose = False):
if verbose:
def popen3(command, verbose = False):
if verbose:
- header(command)
+ header(command
, False
)
(stdin, stdout, stderr) = os.popen3(command)
print >> logfile, "+ "+command
return (stdin, stdout, stderr)
def commands(command, fatal = True, verbose = False):
if verbose:
(stdin, stdout, stderr) = os.popen3(command)
print >> logfile, "+ "+command
return (stdin, stdout, stderr)
def commands(command, fatal = True, verbose = False):
if verbose:
- header(command
)
+ header(command
, False)
(status, output) = getstatusoutput(command)
print >> logfile, "+ "+command
print >> logfile, output.strip()
(status, output) = getstatusoutput(command)
print >> logfile, "+ "+command
print >> logfile, output.strip()