[PATCH 0/1] ci: Fix --engine flag positioning in helper script
The --engine flag was passed before the "run" subcommand, causing lcitool to fail with "invalid choice: 'podman'". Move it to opts so the command is built correctly. 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) Error 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. Radoslaw Smigielski (1): ci: Fix --engine flag positioning in helper script ci/helper | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) -- 2.54.0
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> --- ci/helper | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ci/helper b/ci/helper index 93508515cac8..c13ecd8c8404 100755 --- a/ci/helper +++ b/ci/helper @@ -173,9 +173,6 @@ class Application: "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"""\ @@ -190,6 +187,8 @@ class Application: 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}") -- 2.54.0
On Fri, May 22, 2026 at 18:57:48 +0200, Radoslaw Smigielski via Devel wrote:
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> --- ci/helper | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
For libvirt-ci changes please submit a Merge request against the upstream repo: https://gitlab.com/libvirt/libvirt-ci
On Mon, 25 May 2026 at 08:56, Peter Krempa <pkrempa@redhat.com> wrote:
On Fri, May 22, 2026 at 18:57:48 +0200, Radoslaw Smigielski via Devel
wrote:
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> --- ci/helper | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
For libvirt-ci changes please submit a Merge request against the upstream repo: https://gitlab.com/libvirt/libvirt-ci
Hi Peter, It's a little bit misleading, and maybe my summary should refelect better what is this change about, sorry for that. "ci/helper" script is part of libvirt repo but it's used by CI machiery so this I why I send it here. ---------------------- < Tℏanks | Radek >
On Mon, May 25, 2026 at 09:45:19 +0200, Radoslaw Smigielski wrote:
On Mon, 25 May 2026 at 08:56, Peter Krempa <pkrempa@redhat.com> wrote:
On Fri, May 22, 2026 at 18:57:48 +0200, Radoslaw Smigielski via Devel
wrote:
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> --- ci/helper | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
For libvirt-ci changes please submit a Merge request against the upstream repo: https://gitlab.com/libvirt/libvirt-ci
Hi Peter, It's a little bit misleading, and maybe my summary should refelect better what is this change about, sorry for that.
"ci/helper" script is part of libvirt repo but it's used by CI machiery so this I why I send it here.
Ah, oops. I'm too used for stuff under ci/ to be just re-generated from libvirt-ci and didn't even realize this is a script in libvirt repo with seemingly no counterpart there.
On Fri, May 22, 2026 at 18:57:48 +0200, Radoslaw Smigielski via Devel wrote:
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> --- ci/helper | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/ci/helper b/ci/helper index 93508515cac8..c13ecd8c8404 100755 --- a/ci/helper +++ b/ci/helper @@ -173,9 +173,6 @@ class Application: "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"""\ @@ -190,6 +187,8 @@ class Application: 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}") -- 2.54.0
Reviewed-by: Peter Krempa <pkrempa@redhat.com> and pushed
participants (2)
-
Peter Krempa -
Radoslaw Smigielski