dd1d709
From 00a8c40153b276a63088b7891f866f62161d6f5c Mon Sep 17 00:00:00 2001
dd1d709
From: Bret Fontecchio <bfontecc@redhat.com>
dd1d709
Date: Thu, 30 Nov 2017 15:30:00 -0500
dd1d709
Subject: [PATCH] Add compose-id and signing-intent arguments
dd1d709
dd1d709
Signed-off-by: Bret Fontecchio <bfontecc@redhat.com>
dd1d709
---
dd1d709
 pyrpkg/cli.py     | 27 +++++++++++++++++++++------
dd1d709
 tests/test_cli.py |  6 ++++++
dd1d709
 2 files changed, 27 insertions(+), 6 deletions(-)
dd1d709
dd1d709
diff --git a/pyrpkg/cli.py b/pyrpkg/cli.py
dd1d709
index c8ce3d7..7799d29 100644
dd1d709
--- a/pyrpkg/cli.py
dd1d709
+++ b/pyrpkg/cli.py
dd1d709
@@ -1026,11 +1026,24 @@ see API KEY section of copr-cli(1) man page.
dd1d709
             help='Build a container',
dd1d709
             description='Build a container')
dd1d709
 
dd1d709
-        self.container_build_parser.add_argument(
dd1d709
-            '--repo-url',
dd1d709
-            metavar="URL",
dd1d709
-            help=('URL of yum repo file'),
dd1d709
-            nargs='*')
dd1d709
+        group = self.container_build_parser.add_mutually_exclusive_group()
dd1d709
+        group.add_argument(
dd1d709
+                           '--compose-id',
dd1d709
+                           dest='compose_ids',
dd1d709
+                           metavar='COMPOSE_ID',
dd1d709
+                           help='ODCS composes used. '
dd1d709
+                                'Cannot be used with --signing-intent or --repo-url',
dd1d709
+                           nargs='*')
dd1d709
+        group.add_argument(
dd1d709
+                          '--signing-intent',
dd1d709
+                          help='Signing intent of the ODCS composes. Cannot be '
dd1d709
+                               'used with --compose-id or --repo-url')
dd1d709
+        group.add_argument(
dd1d709
+                          '--repo-url',
dd1d709
+                          metavar="URL",
dd1d709
+                          help='URL of yum repo file'
dd1d709
+                               'Cannot be used with --signing-intent or --compose-id',
dd1d709
+                          nargs='*')
dd1d709
 
dd1d709
         self.container_build_parser.add_argument(
dd1d709
             '--target',
dd1d709
@@ -1280,7 +1293,9 @@ see API KEY section of copr-cli(1) man page.
dd1d709
                 "quiet": self.args.q,
dd1d709
                 "yum_repourls": self.args.repo_url,
dd1d709
                 "git_branch": self.cmd.branch_merge,
dd1d709
-                "arches": self.args.arches}
dd1d709
+                "arches": self.args.arches,
dd1d709
+                "compose_ids": self.args.compose_ids,
dd1d709
+                "signing_intent": self.args.signing_intent}
dd1d709
 
dd1d709
         section_name = "%s.container-build" % self.name
dd1d709
         err_msg = "Missing %(option)s option in [%(plugin.section)s] section. " \
dd1d709
diff --git a/tests/test_cli.py b/tests/test_cli.py
dd1d709
index 11b9bc8..2ba93ea 100644
dd1d709
--- a/tests/test_cli.py
dd1d709
+++ b/tests/test_cli.py
dd1d709
@@ -205,6 +205,8 @@ class TestContainerBuildWithKoji(CliTestCase):
dd1d709
                 'yum_repourls': None,
dd1d709
                 'git_branch': 'eng-rhel-7',
dd1d709
                 'arches': None,
dd1d709
+                'signing_intent': None,
dd1d709
+                'compose_ids': None
dd1d709
             },
dd1d709
             kojiconfig=None,
dd1d709
             kojiprofile='koji',
dd1d709
@@ -230,6 +232,8 @@ class TestContainerBuildWithKoji(CliTestCase):
dd1d709
                 'yum_repourls': None,
dd1d709
                 'git_branch': 'eng-rhel-7',
dd1d709
                 'arches': None,
dd1d709
+                'signing_intent': None,
dd1d709
+                'compose_ids': None
dd1d709
             },
dd1d709
             kojiconfig=None,
dd1d709
             kojiprofile='koji',
dd1d709
@@ -264,6 +268,8 @@ class TestContainerBuildWithKoji(CliTestCase):
dd1d709
                 'yum_repourls': None,
dd1d709
                 'git_branch': 'eng-rhel-7',
dd1d709
                 'arches': None,
dd1d709
+                'signing_intent': None,
dd1d709
+                'compose_ids': None
dd1d709
             },
dd1d709
             kojiconfig='/path/to/koji.conf',
dd1d709
             kojiprofile=None,
dd1d709
-- 
dd1d709
2.14.3
dd1d709