Index: command_wrapper/bin/command_wrapper.py |
=================================================================== |
--- command_wrapper/bin/command_wrapper.py (revision 54349) |
+++ command_wrapper/bin/command_wrapper.py (working copy) |
@@ -35,6 +35,9 @@ |
stdout: text of stdout |
stderr: text of stderr |
runtime: command runtime in seconds |
+ Returns: |
+ True/False indicating if the current result should be accepted without |
+ further retry. |
""" |
uname = platform.uname() |
params = urllib.urlencode({ |
@@ -55,8 +58,9 @@ |
'uname_processor': uname[5], |
}) |
f = urllib.urlopen(options.logurl, params) |
- f.read() |
+ ret = f.read() |
f.close() |
+ return int(ret) != 0 |
def main(argv): |
@@ -80,8 +84,10 @@ |
sys.stdout.write(p_stdout) |
sys.stderr.write(p_stderr) |
runtime = time.time() - tm |
- LogCommand(options, command_id, r, cmd, |
- p.returncode, p_stdout, p_stderr, runtime) |
+ accept = LogCommand(options, command_id, r, cmd, |
+ p.returncode, p_stdout, p_stderr, runtime) |
+ if accept: |
+ return p.returncode |
if p.returncode == 0: |
return 0 |
print 'Command %s failed with retcode %d, try %d.' % ( |