The --engine flag was being added to positional_args before the "run"
subcommand, which resulted in incorrect lcitool invocations:
lcitool container --engine podman run ... (wrong)
This caused "invalid choice: 'podman'" errors because lcitool expected
a COMMAND argument at that position.
Fix by moving the --engine flag to opts array, which is added after
the "run" subcommand, resulting in the correct command structure:
lcitool container run --engine podman ... (correct)
Example:
$ ./ci/helper run fedora-44 --job codestyle --engine podman
usage: lcitool container [-h] COMMAND ...
lcitool container: error: argument COMMAND: invalid choice: 'podman' (choose from engines, build, run, shell)
The same error happens if "--engine" option is set to different
than "auto" value.
Signed-off-by: Radoslaw Smigielski <rsmigiel@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
"website": "run_website_build",
}
- if self._args.engine != "auto":
- positional_args.extend(["--engine", self._args.engine])
-
with open(Path(tmpdir.name, "script"), "w") as f:
script_path = f.name
contents = textwrap.dedent(f"""\
f.write(contents)
positional_args.append("run")
+ if self._args.engine != "auto":
+ opts.extend(["--engine", self._args.engine])
opts.extend(["--script", script_path])
opts.append(f"{self._args.image_prefix}{self._args.target}:{self._args.image_tag}")