summaryrefslogtreecommitdiff
path: root/morphlib
diff options
context:
space:
mode:
authorSam Thursfield <sam.thursfield@codethink.co.uk>2015-03-11 10:41:49 +0000
committerSam Thursfield <sam.thursfield@codethink.co.uk>2015-03-11 10:41:49 +0000
commit68395a12c79c22e266b4a06095533e38da6e29d0 (patch)
treef004fb3122bac502b127faf70e868bd56a0cb409 /morphlib
parent11559bbbd24c218d512d503df27157668b37bdc9 (diff)
parenteba2e42855e9413f035e5093d64543184dce6fae (diff)
downloadmorph-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')
-rw-r--r--morphlib/buildcommand.py10
-rw-r--r--morphlib/plugins/distbuild_plugin.py1
2 files changed, 9 insertions, 2 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()
diff --git a/morphlib/plugins/distbuild_plugin.py b/morphlib/plugins/distbuild_plugin.py
index a7d69472..24d5584c 100644
--- a/morphlib/plugins/distbuild_plugin.py
+++ b/morphlib/plugins/distbuild_plugin.py
@@ -180,7 +180,6 @@ class ControllerDaemon(cliapp.Plugin):
self.app.settings.string(
['initiator-step-output-dir'],
'write build output to files in DIR',
- default='.',
group=group_distbuild)
self.app.settings.string(