From 07c0d2804c260085e1da2da6a9fa41a24c6c743d Mon Sep 17 00:00:00 2001 From: Ondrej Nosek Date: Jul 16 2019 08:53:54 +0000 Subject: Allow some arguments for container-build together For `rhpkg container-build` command allow --signing-intent together with --repo-url. --compose-id is still restricted to be used with these arguments. JIRA: COMPOSE-3622 Signed-off-by: Ondrej Nosek --- diff --git a/pyrpkg/cli.py b/pyrpkg/cli.py index 97dec0f..91e6e06 100644 --- a/pyrpkg/cli.py +++ b/pyrpkg/cli.py @@ -1541,25 +1541,21 @@ see API KEY section of copr-cli(1) man page. # --repo-url makes no sense for flatpaks, since they must be built from a # compose of a single module. - group = self.container_build_parser.add_mutually_exclusive_group() - group.add_argument( - '--compose-id', - dest='compose_ids', - metavar='COMPOSE_ID', - type=int, - help='ODCS composes used. ' - 'Cannot be used with --signing-intent or --repo-url', - nargs='+') - group.add_argument( - '--signing-intent', - help='Signing intent of the ODCS composes. Cannot be ' - 'used with --compose-id or --repo-url') - group.add_argument( - '--repo-url', - metavar="URL", - help='URLs of yum repo files' - 'Cannot be used with --signing-intent or --compose-id', - nargs='+') + self.container_build_parser.add_argument( + '--compose-id', + dest='compose_ids', + metavar='COMPOSE_ID', + type=int, + help='ODCS composes used. Cannot be used with --signing-intent or --repo-url', + nargs='+') + self.container_build_parser.add_argument( + '--signing-intent', + help='Signing intent of the ODCS composes.') + self.container_build_parser.add_argument( + '--repo-url', + metavar="URL", + help='URLs of yum repo files', + nargs='+') self.container_build_parser.set_defaults(command=self.container_build) @@ -1950,6 +1946,9 @@ see API KEY section of copr-cli(1) man page. "arches": self.args.arches} if not flatpak: + if self.args.compose_ids and (self.args.repo_url or self.args.signing_intent): + raise rpkgError("argument --compose-id: not allowed with argument" + " --repo-url or --signing-intent") opts.update({ "yum_repourls": self.args.repo_url, "compose_ids": self.args.compose_ids,