summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Ipsum <richard.ipsum@codethink.co.uk>2015-04-28 16:00:38 +0100
committerRichard Ipsum <richardipsum@fastmail.co.uk>2015-04-29 16:11:26 +0000
commitac6d1896b3acdf9f6d0cf6019b14b32c570d1e58 (patch)
treebb833eeb9f997179358278675a590d87a5234ef1
parent4941d1dd806d1751b1ac0f7a695ec2b6dce93ba0 (diff)
downloadmorph-ac6d1896b3acdf9f6d0cf6019b14b32c570d1e58.tar.gz
Remove n_state_machines_of_type function
Change-Id: Icfc3d1aa125196e208d7ac35f43f06c5f5a21ba4
-rw-r--r--distbuild/build_controller.py3
-rw-r--r--distbuild/mainloop.py3
2 files changed, 2 insertions, 4 deletions
diff --git a/distbuild/build_controller.py b/distbuild/build_controller.py
index e38b25b7..0a3bd8a8 100644
--- a/distbuild/build_controller.py
+++ b/distbuild/build_controller.py
@@ -296,7 +296,8 @@ class BuildController(distbuild.StateMachine):
def _request_command_execution(self, argv, request_id):
'''Tell the controller's distbuild-helper to run a command.'''
- if self.mainloop.n_state_machines_of_type(distbuild.HelperRouter) == 0:
+ hrs = self.mainloop.state_machines_of_type(distbuild.HelperRouter)
+ if len(hrs) == 0:
self.fail('No distbuild-helper process running on controller!')
msg = distbuild.message('exec-request',
diff --git a/distbuild/mainloop.py b/distbuild/mainloop.py
index 4d5a2b61..34fd3b4f 100644
--- a/distbuild/mainloop.py
+++ b/distbuild/mainloop.py
@@ -61,9 +61,6 @@ class MainLoop(object):
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(self.state_machines_of_type(machine_type))
-
def add_event_source(self, event_source):
logging.debug('MainLoop.add_event_source: %s' % event_source)
self._sources.append(event_source)