Print out a useful summary at the end of watch output.

Fixes #525.
This commit is contained in:
Ralph Bean
2017-05-04 12:58:19 -04:00
parent 155853fa3c
commit 9ffbd0d245

View File

@@ -79,7 +79,11 @@ def watch_build(server, build_id):
done = data["state_name"] in ["failed", "done", "ready"]
print('Module {name} is in state {state_name} (reason {state_reason})'.format(**data))
template = ('{owner}\'s build #{id} of {name}-{stream} is in '
'the "{state_name}" state')
if data['state_reason']:
template += ' (reason: {state_reason})'
print(template.format(**data))
time.sleep(30)
# Ideally we would use oidc.send_request here, but it doesn't support