diff options
Diffstat (limited to 'distbuild')
-rw-r--r-- | distbuild/initiator.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/distbuild/initiator.py b/distbuild/initiator.py index d0185608..3b85826c 100644 --- a/distbuild/initiator.py +++ b/distbuild/initiator.py @@ -353,6 +353,7 @@ class InitiatorCancel(distbuild.StateMachine): handlers = { 'request-output': self._handle_request_output, + 'build-failed': self._handle_build_failed_message, } handler = handlers[event.msg['type']] @@ -363,6 +364,12 @@ class InitiatorCancel(distbuild.StateMachine): self.mainloop.queue_event(self._cm, distbuild.StopConnecting()) self._jm.close() + def _handle_build_failed_message(self, msg): + self._app.status(msg=str(msg['reason'])) + self.mainloop.queue_event(self, _Failed(msg)) + self.mainloop.queue_event(self._cm, distbuild.StopConnecting()) + self._jm.close() + def _terminate(self, event_source, event): self.mainloop.queue_event(self._cm, distbuild.StopConnecting()) self._jm.close() @@ -471,6 +478,7 @@ class InitiatorStatus(distbuild.StateMachine): handlers = { 'request-output': self._handle_request_output, + 'build-failed': self._handle_build_failed_message, } handler = handlers[event.msg['type']] @@ -481,6 +489,12 @@ class InitiatorStatus(distbuild.StateMachine): self.mainloop.queue_event(self._cm, distbuild.StopConnecting()) self._jm.close() + def _handle_build_failed_message(self, msg): + self._app.status(msg=str(msg['reason'])) + self.mainloop.queue_event(self, _Failed(msg)) + self.mainloop.queue_event(self._cm, distbuild.StopConnecting()) + self._jm.close() + def _terminate(self, event_source, event): self.mainloop.queue_event(self._cm, distbuild.StopConnecting()) self._jm.close() |