run() also supports single string, but if we pass a longstring literal
which contains "\n", it renders log difficult to read.
in this change, multi-line command is logged in multiple lines,
and print the "prefix" in the first line, then print the command in
following lines without "prefix".
Signed-off-by: Kyr Shatskyy <kyrylo.shatskyy@suse.com>
prefix = "Running:"
if self.label:
prefix = "Running ({label}):".format(label=self.label)
- log.getChild(self.hostname).info(u"{prefix} {cmd!r}".format(
- cmd=self.command, prefix=prefix))
+ log.getChild(self.hostname).info(prefix)
+ for line in self.command.split('\n'):
+ log.getChild(self.hostname).info('> %s' % line)
if hasattr(self, 'timeout'):
(self._stdin_buf, self._stdout_buf, self._stderr_buf) = \