]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
ci: Fix --engine flag positioning in helper script
authorRadoslaw Smigielski via Devel <devel@lists.libvirt.org>
Fri, 22 May 2026 16:57:48 +0000 (18:57 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 25 May 2026 08:17:01 +0000 (10:17 +0200)
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>
ci/helper

index 93508515cac83820a936fb454d98cc8b1b78d6ef..c13ecd8c8404f6497e566332bb1c56c04fa0363b 100755 (executable)
--- 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}")