From ac6d1896b3acdf9f6d0cf6019b14b32c570d1e58 Mon Sep 17 00:00:00 2001 From: Richard Ipsum Date: Tue, 28 Apr 2015 16:00:38 +0100 Subject: Remove n_state_machines_of_type function Change-Id: Icfc3d1aa125196e208d7ac35f43f06c5f5a21ba4 --- distbuild/build_controller.py | 3 ++- distbuild/mainloop.py | 3 --- 2 files changed, 2 insertions(+), 4 deletions(-) (limited to 'distbuild') 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) -- cgit v1.2.1