diff options
author | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2015-02-11 11:40:17 +0000 |
---|---|---|
committer | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2015-02-11 12:53:58 +0000 |
commit | fae23a5162e40a559f931279ae72b940aba8064d (patch) | |
tree | 465c633abe4cfbedbe5d6e98709a77a5b008773b /distbuild/build_controller.py | |
parent | decb0ea74d30461bf79ecddb6e23231cb696a76c (diff) | |
download | morph-fae23a5162e40a559f931279ae72b940aba8064d.tar.gz |
distbuild: Rearrange code that sends exec-request message
Diffstat (limited to 'distbuild/build_controller.py')
-rw-r--r-- | distbuild/build_controller.py | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/distbuild/build_controller.py b/distbuild/build_controller.py index 387b410f..1794586d 100644 --- a/distbuild/build_controller.py +++ b/distbuild/build_controller.py @@ -244,6 +244,15 @@ class BuildController(distbuild.StateMachine): self.mainloop.queue_event(self, _Start()) + def _request_command_execution(self, argv, request_id): + '''Tell the controller's distbuild-helper to run a command.''' + msg = distbuild.message('exec-request', + id=request_id, + argv=argv, + stdin_contents='') + req = distbuild.HelperRequest(msg) + self.mainloop.queue_event(distbuild.HelperRouter, req) + def _start_graphing(self, event_source, event): distbuild.crash_point() @@ -260,14 +269,10 @@ class BuildController(distbuild.StateMachine): ] if 'original_ref' in self._request: argv.append(self._request['original_ref']) - msg = distbuild.message('exec-request', - id=self._idgen.next(), - argv=argv, - stdin_contents='') - self._helper_id = msg['id'] - req = distbuild.HelperRequest(msg) - self.mainloop.queue_event(distbuild.HelperRouter, req) - + + self._helper_id = self._idgen.next() + self._request_command_execution(argv, self._helper_id) + progress = BuildProgress(self._request['id'], 'Computing build graph') self.mainloop.queue_event(BuildController, progress) |