Commit 67d4b057 authored by Łukasz Nowak's avatar Łukasz Nowak

WIP: Improve even more communication and status

parent bef98662
......@@ -107,8 +107,8 @@ def main():
result_file = os.path.abspath(result_file)
status_dict['command'] = result_file
result = open(result_file).read()
print(try_info + 'Analysis of result %r:' % (result_file,))
print(try_info + result)
print(try_info + ' Analysis of result %r:' % (result_file,))
print(try_info + ' ' + result)
if 'FATAL: all hosts have already failed -- aborting' in result:
# failed
status_dict.update(
......@@ -118,6 +118,8 @@ def main():
error_count=0
)
finished = False
status_dict['stdout'] = 'Build not yet successful.'
print(try_info + ' %r: Found not yet finished run.' % (result_file,))
elif "\"msg\": \"[u'Build successful, connect to:', u'" in result:
# success
status_dict.update(
......@@ -127,6 +129,8 @@ def main():
error_count=0
)
finished = True
print(try_info + ' %r: Found finished successful run.' % (result_file,))
status_dict['stdout'] = 'Build successful.'
break
else:
# unknown
......@@ -138,13 +142,14 @@ def main():
)
status_dict['stdout'] = \
'Cannot find success or failure result in the output'
print(try_info + ' %r: Found unknown run.' % (result_file,))
finished = False
# send only part of the result
status_dict['stderr'] = result[-8192:]
if finished:
break
if try_num > try_amount:
print(try_info + ' Time exceeded, data not found.')
msg = try_info + ' Time exceeded, success not found.'
print(msg)
status_dict['stderr'] = msg
break
try_num += 1
sleep(10)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment