Skip to content

Commit 204818e

Browse files
committed
jobs.py: don't ignore --host-version when --hosts is passed
When using --hosts=cache://... it is much too early for such a check, so we have to give the info manually, and the script would not allow this. And honor it not just for "collect".
1 parent 294ada4 commit 204818e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

jobs.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,7 @@ def build_pytest_cmd(job_data, hosts=None, host_version=None, pytest_args=[]):
580580
job_params = dict(job_data["params"])
581581

582582
# Set/overwrite host_version with real host version if hosts are specified
583-
if hosts is not None:
583+
if hosts is not None and host_version is None:
584584
try:
585585
host = hosts.split(',')[0]
586586
cmd = ["lsb_release", "-sr"]
@@ -734,6 +734,7 @@ def action_run(args):
734734

735735
def main():
736736
parser = argparse.ArgumentParser(description="Manage test jobs")
737+
parser.add_argument("-v", "--host-version", help="host version to match VM filters.")
737738
subparsers = parser.add_subparsers(dest="action", metavar="action")
738739
subparsers.required = True
739740

@@ -746,7 +747,6 @@ def main():
746747

747748
run_parser = subparsers.add_parser("collect", help="show test collection based on the job definition.")
748749
run_parser.add_argument("job", help="name of the job.", choices=JOBS.keys(), metavar="job")
749-
run_parser.add_argument("-v", "--host-version", help="host version to match VM filters.")
750750
run_parser.add_argument("pytest_args", nargs=argparse.REMAINDER,
751751
help="all additional arguments after the last positional argument will "
752752
"be passed to pytest and replace default job params if needed.")

0 commit comments

Comments
 (0)