diff options
author | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2015-02-18 15:54:56 +0000 |
---|---|---|
committer | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2015-02-18 16:32:50 +0000 |
commit | eba2e42855e9413f035e5093d64543184dce6fae (patch) | |
tree | 49dd65e174e7d52d8eec4a934c90c833a22797c4 /distbuild/mainloop.py | |
parent | 46a8e0de14ce2cca4c93ec53648d7e01333bbf65 (diff) | |
download | morph-eba2e42855e9413f035e5093d64543184dce6fae.tar.gz |
distbuild: Log in build-step-xx.log files when initiator cancels build
This makes it easier to spot if an incomplete build was due to the user
cancelling, or if it represents a dropped connection or internal error.
Diffstat (limited to 'distbuild/mainloop.py')
-rw-r--r-- | distbuild/mainloop.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/distbuild/mainloop.py b/distbuild/mainloop.py index 97e439f3..f15a3ac1 100644 --- a/distbuild/mainloop.py +++ b/distbuild/mainloop.py @@ -57,8 +57,11 @@ class MainLoop(object): logging.debug('MainLoop.remove_state_machine: %s' % machine) self._machines.remove(machine) + def state_machines_of_type(self, machine_type): + return [m for m in self._machines if isinstance(m, machine_type)] + def n_state_machines_of_type(self, machine_type): - return len([m for m in self._machines if isinstance(m, machine_type)]) + return len(self.state_machines_of_type(machine_type)) def add_event_source(self, event_source): logging.debug('MainLoop.add_event_source: %s' % event_source) |