From 2ca0f3b3707ee5181c599dd9954dea29c5f81482 Mon Sep 17 00:00:00 2001 From: Christian Kellner Date: Tue, 25 Jan 2022 17:34:37 +0000 Subject: [PATCH] builder: make `repo` a proper optional argument When the builder is used as an command line binary: have `repo` be a proper command line argument. It was currently specified before arch which can be passed multiple times, but so does repo; hence one of them needs to be optional. --- plugins/builder/osbuild.py | 4 ++-- test/unit/test_builder.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/builder/osbuild.py b/plugins/builder/osbuild.py index acd286e..0c35761 100644 --- a/plugins/builder/osbuild.py +++ b/plugins/builder/osbuild.py @@ -551,10 +551,10 @@ def main(): subpar.add_argument("version", metavar="VERSION", help='The version') subpar.add_argument("release", metavar="RELEASE", help='The release') subpar.add_argument("distro", metavar="DISTRO", help='The distribution') - subpar.add_argument("repo", metavar="REPO", help='The repository to use', - type=str, action="append", default=[]) subpar.add_argument("arch", metavar="ARCHITECTURE", help='Request the architecture', type=str, nargs="+") + subpar.add_argument("--repo", metavar="REPO", help='The repository to use', + type=str, action="append", default=[]) subpar.add_argument("--format", metavar="FORMAT", help='Request the image format [qcow2]', action="append", type=str, default=[]) subpar.add_argument("--koji", metavar="URL", help='The koji url', diff --git a/test/unit/test_builder.py b/test/unit/test_builder.py index 9a71950..a908046 100644 --- a/test/unit/test_builder.py +++ b/test/unit/test_builder.py @@ -645,8 +645,8 @@ class TestBuilderPlugin(PluginTest): "33", "20201015.0", "fedora-33", - "http://download.localhost/pub/linux/$arch", "x86_64", + "--repo", "http://download.localhost/pub/linux/$arch", "--cert", ", ".join(certs), "--ca", "test/data/example-ca.pem" ]