Blob Blame History Raw
From c0c26f8512e5369b4616a98a34de306c666c709f Mon Sep 17 00:00:00 2001
From: Robert Cerven <rcerven@redhat.com>
Date: Mon, 4 Nov 2019 15:29:06 +0100
Subject: [PATCH] Isolated container-build should allow arches override

JIRA: OSBS-8025
Merges: https://pagure.io/rpkg/pull-request/471

Signed-off-by: Robert Cerven <rcerven@redhat.com>
---
 pyrpkg/__init__.py | 6 ++++--
 pyrpkg/cli.py      | 4 ++--
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/pyrpkg/__init__.py b/pyrpkg/__init__.py
index b139fe0..bcacca1 100644
--- a/pyrpkg/__init__.py
+++ b/pyrpkg/__init__.py
@@ -3133,9 +3133,11 @@ class Commands(object):
 
             scratch = opts.get('scratch')
             arches = opts.get('arches')
+            isolated = opts.get('isolated')
             if arches:
-                if not scratch:
-                    raise rpkgError('Cannot override arches for non-scratch builds')
+                if not (scratch or isolated):
+                    raise rpkgError('Cannot override arches for non-scratch and non-isolated '
+                                    'builds')
                 task_opts['arch_override'] = ' '.join(arches)
 
             if flatpak:
diff --git a/pyrpkg/cli.py b/pyrpkg/cli.py
index 0036136..eb17284 100644
--- a/pyrpkg/cli.py
+++ b/pyrpkg/cli.py
@@ -1566,7 +1566,7 @@ see API KEY section of copr-cli(1) man page.
             '--arches',
             action='store',
             nargs='*',
-            help='Limit a scratch build to an arch. May have multiple arches.')
+            help='Limit a scratch or a isolated build to an arch. May have multiple arches.')
 
         parser.add_argument(
             '--skip-remote-rules-validation',
@@ -2270,7 +2270,7 @@ see API KEY section of copr-cli(1) man page.
             build_id, auth_method, oidc_id_provider, oidc_client_id,
             oidc_client_secret, oidc_scopes)
         if not self.args.q:
-                print('The module build #{0} was cancelled'.format(build_id))
+            print('The module build #{0} was cancelled'.format(build_id))
 
     def module_build_info(self):
         """Show information about an MBS build"""
-- 
2.21.0