:param vm: vm to run on if running on a guest instead of the host
:type vm: :py:class:`virttest.qemu_vm.VM` or None
:param int timeout: amount of seconds to wait for the program to run
- :returns: command result output
- :rtype: str
+ :returns: command result output where output (stdout/stderr) is bytes
+ (encoding dependent on environment and command given)
+ :rtype: :py:class:`subprocess.CompletedProcess`
:raises: :py:class:`OSError` if command failed and cannot be ignored
"""
if vm is not None:
stdout = b""
if not ignore_errors:
raise subprocess.CalledProcessError(status, cmd, stderr=stderr)
- return subprocess.CompletedProcess(cmd, status, stdout=stdout, stderr=stderr)
+ return subprocess.CompletedProcess(cmd, status,
+ stdout=stdout, stderr=stderr)
else:
- return subprocess.run(cmd, check=not ignore_errors, shell=True, capture_output=True)
+ return subprocess.run(cmd, check=not ignore_errors, shell=True,
+ capture_output=True)
def verify_running(process='arnied', timeout=60, vm=None):