diff options
author | Lars Wirzenius <liw@liw.fi> | 2018-06-24 20:11:50 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2018-06-24 20:11:50 +0300 |
commit | 28c7f111a67ba38a11607ef846fc265b413c1fcf (patch) | |
tree | 680be5a9d75f25d020fad126cc2302c55231fe94 /ick2 | |
parent | e8d978342b02d5d4a22bbb8374bd1c92dc81dd1e (diff) | |
download | ick2-28c7f111a67ba38a11607ef846fc265b413c1fcf.tar.gz |
Change: set build exit code when an action ends, override later
When a build action ends, we now set the *build* exit code to that of
the action. Not for notification actions.
This is all so that notifications can have the right exit code.
Diffstat (limited to 'ick2')
-rw-r--r-- | ick2/buildsm.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/ick2/buildsm.py b/ick2/buildsm.py index 2e6d079..9177e09 100644 --- a/ick2/buildsm.py +++ b/ick2/buildsm.py @@ -122,6 +122,7 @@ class BuildStateMachine: return BUILD_NOTIFYING, (action_id, action) def mark_action_done(self, event): + self.build.resource['exit_code'] = event.exit_code graph = self.build.get_graph() graph.set_action_status(event.action_id, ick2.ACTION_DONE) graph.unblock() @@ -139,13 +140,15 @@ class BuildStateMachine: graph.append_action(action, ick2.ACTION_READY, depends=[]) def mark_notification_done(self, event): + if event.exit_code not in (0, None): # pragma: no cover + self.build.resource['exit_code'] = event.exit_code graph = self.build.get_graph() graph.set_action_status(event.action_id, ick2.ACTION_DONE) graph.unblock() if graph.has_more_to_do(): # pragma: no cover return BUILD_NOTIFYING, None - if self.build.resource.get('exit_code') is None: + if self.build.resource.get('exit_code') in (0, None): self.build.resource['exit_code'] = 0 return BUILD_DONE, None @@ -206,6 +209,7 @@ class ActionFinishedEvent(BuildEvent): def __init__(self, action_id): self.action_id = action_id + self.exit_code = 0 class ActionFailedEvent(BuildEvent): |