diff options
author | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2015-03-11 10:41:49 +0000 |
---|---|---|
committer | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2015-03-11 10:41:49 +0000 |
commit | 68395a12c79c22e266b4a06095533e38da6e29d0 (patch) | |
tree | f004fb3122bac502b127faf70e868bd56a0cb409 /morphlib/buildcommand.py | |
parent | 11559bbbd24c218d512d503df27157668b37bdc9 (diff) | |
parent | eba2e42855e9413f035e5093d64543184dce6fae (diff) | |
download | morph-68395a12c79c22e266b4a06095533e38da6e29d0.tar.gz |
Merge branch 'sam/distbuild-build-logs'
Reviewed-By: Adam Coldrick <adam.coldrick@codethink.co.uk>
Reviewed-By: Richard Maw <richard.maw@codethink.co.uk>
Diffstat (limited to 'morphlib/buildcommand.py')
-rw-r--r-- | morphlib/buildcommand.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/morphlib/buildcommand.py b/morphlib/buildcommand.py index 8572450d..6e7c9bbd 100644 --- a/morphlib/buildcommand.py +++ b/morphlib/buildcommand.py @@ -544,4 +544,12 @@ class InitiatorBuildCommand(BuildCommand): self.MAX_RETRIES) loop.add_state_machine(cm) - loop.run() + try: + loop.run() + except KeyboardInterrupt: + # This will run if the user presses Ctrl+C or sends SIGINT during + # the build. It won't trigger on SIGTERM, SIGKILL or unhandled + # Python exceptions. + logging.info('Received KeyboardInterrupt, aborting.') + for initiator in loop.state_machines_of_type(distbuild.Initiator): + initiator.handle_cancel() |