Skip to content

Commit

Permalink
Merge pull request #203 from xcp-ng/fix/jobs.py_subprocess_output_cap…
Browse files Browse the repository at this point in the history
…ture

jobs.py: Fix subprocess.run() output capture
  • Loading branch information
tescande authored Mar 4, 2024
2 parents b59e7ad + d998b6b commit 09c057e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,11 +397,12 @@ def build_pytest_cmd(job_data, hosts=None, pytest_args=[]):
try:
host = hosts.split(',')[0]
cmd = ["ssh", host, "lsb_release", "-sr"]
res = subprocess.run(cmd, capture_output=True, text=True)
res = subprocess.run(cmd, stdout=subprocess.PIPE, check=True)
if res.returncode == 0:
host_version = res.stdout.strip()
host_version = res.stdout.decode().strip()
except Exception as e:
print(e, file=sys.stderr)
print(f"Host version is '{host_version}'")

def _join_pytest_args(arg, option):
cli_args = []
Expand Down

0 comments on commit 09c057e

Please sign in to comment.