Awight has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/346667 )
Change subject: Handle commandline param like other fields. ...................................................................... Handle commandline param like other fields. Change-Id: Iab17d09434914b4fde7a0dc06b8c3ff32e1df54f --- M processcontrol/job_wrapper.py 1 file changed, 10 insertions(+), 9 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/process-control refs/changes/67/346667/1 diff --git a/processcontrol/job_wrapper.py b/processcontrol/job_wrapper.py index 7d9817a..25f958c 100644 --- a/processcontrol/job_wrapper.py +++ b/processcontrol/job_wrapper.py @@ -66,6 +66,14 @@ str_env = {k: str(v) for k, v in self.config.get("environment").items()} self.environment.update(str_env) + command = self.config.get("command") + if hasattr(command, "encode"): + # Is stringlike, so cast to a list and handle along with the plural + # case below. + command = [command] + + self.commands = command + def run(self): # Check that we are the service user. service_user = str(self.global_config.get("user")) @@ -86,16 +94,9 @@ timer = threading.Timer(timeout_seconds, self.fail_timeout) timer.start() - command = self.config.get("command") - - if hasattr(command, "encode"): - # Is stringlike, so cast to a list and handle along with the plural - # case below. - command = [command] - try: - for line in command: - self.run_command(line) + for command_line in self.commands: + self.run_command(command_line) finally: lock.end() if self.timeout > 0: -- To view, visit https://gerrit.wikimedia.org/r/346667 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iab17d09434914b4fde7a0dc06b8c3ff32e1df54f Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/fundraising/process-control Gerrit-Branch: master Gerrit-Owner: Awight <awi...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits