diff --git a/flamenco_worker/commands.py b/flamenco_worker/commands.py index d26ecdfc09d4a5fba05ae2072a2b44fa15603fec..0c8fb5ebfad885b9db4ebd81c8b8b482a5286a04 100644 --- a/flamenco_worker/commands.py +++ b/flamenco_worker/commands.py @@ -508,12 +508,12 @@ class AbstractSubprocessCommand(AbstractCommand): await self.worker.register_log(processed_line) retcode = await self.proc.wait() - cmdline = ' '.join(shlex.quote(arg) for arg in args) - self._log.info('Command %r (pid=%d) stopped with status code %s', cmdline, pid, retcode) + self._log.info('Command %s (pid=%d) stopped with status code %s', + cmd_to_log, pid, retcode) if retcode: - raise CommandExecutionError('Command %r (pid=%d) failed with status %s' % - (cmdline, pid, retcode)) + raise CommandExecutionError('Command %s (pid=%d) failed with status %s' % + (cmd_to_log, pid, retcode)) except asyncio.CancelledError: self._log.info('asyncio task got canceled, killing subprocess pid=%d', pid) await self.abort() diff --git a/tests/test_runner.py b/tests/test_runner.py index 9c0f83e90dd3cd7e45e397381b13790f6bd53b2f..829dca00773b073d92c8c5de8bd29ba003508233 100644 --- a/tests/test_runner.py +++ b/tests/test_runner.py @@ -162,11 +162,11 @@ class ExecCommandTest(AbstractCommandTest): '%s -c \'raise SystemExit("¡FAIL!")\'' % sys.executable), call('pid=%d > ¡FAIL!' % pid), # note the logged line doesn't end in a newline call('exec.(task_id=12345, command_idx=0): Error executing: ' - 'Command pid=%d failed with status 1' % pid) + 'Command %s (pid=%d) failed with status 1' % (settings['cmd'], pid)) ]) # The update should NOT contain a new task status -- that is left to the Worker. self.fworker.register_task_update.assert_called_with( activity='exec.(task_id=12345, command_idx=0): Error executing: ' - 'Command pid=%d failed with status 1' % pid, + 'Command %s (pid=%d) failed with status 1' % (settings['cmd'], pid), )