diff options
author | Lars Wirzenius <liw@liw.fi> | 2018-06-24 19:37:32 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2018-06-24 19:37:32 +0300 |
commit | e8d978342b02d5d4a22bbb8374bd1c92dc81dd1e (patch) | |
tree | 105d66e40579abd737adc0a7cda9b5e765915736 | |
parent | 53da684d47648e6303b126a63017e47e87fd0e03 (diff) | |
download | ick2-e8d978342b02d5d4a22bbb8374bd1c92dc81dd1e.tar.gz |
Change: mangle build status for notifications
-rw-r--r-- | ick2/actions.py | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/ick2/actions.py b/ick2/actions.py index 3d77aa5..8c52475 100644 --- a/ick2/actions.py +++ b/ick2/actions.py @@ -14,6 +14,7 @@ import base64 +import copy import json import os import tempfile @@ -496,7 +497,7 @@ class NotifyAction(Action): # pragma: no cover notify = { 'recipients': recipients, - 'build': build, + 'build': self.mangle_build(build), 'log': log, } @@ -504,6 +505,17 @@ class NotifyAction(Action): # pragma: no cover env.report(0, 'Notified about build {} ending\n'.format(build_id)) + def mangle_build(self, build): + b = copy.deepcopy(build) + exit_code = build.get('exit_code') + if exit_code is None: + b['status'] = 'BUILDING' + elif exit_code == 0: + b['status'] = 'SUCCESS' + else: + b['status'] = 'FAILED' + return b + def make_directory_empty(env, dirname): return env.runcmd( |