4ed51c3
From c0c26f8512e5369b4616a98a34de306c666c709f Mon Sep 17 00:00:00 2001
4ed51c3
From: Robert Cerven <rcerven@redhat.com>
4ed51c3
Date: Mon, 4 Nov 2019 15:29:06 +0100
4ed51c3
Subject: [PATCH] Isolated container-build should allow arches override
4ed51c3
4ed51c3
JIRA: OSBS-8025
4ed51c3
Merges: https://pagure.io/rpkg/pull-request/471
4ed51c3
4ed51c3
Signed-off-by: Robert Cerven <rcerven@redhat.com>
4ed51c3
---
4ed51c3
 pyrpkg/__init__.py | 6 ++++--
4ed51c3
 pyrpkg/cli.py      | 4 ++--
4ed51c3
 2 files changed, 6 insertions(+), 4 deletions(-)
4ed51c3
4ed51c3
diff --git a/pyrpkg/__init__.py b/pyrpkg/__init__.py
4ed51c3
index b139fe0..bcacca1 100644
4ed51c3
--- a/pyrpkg/__init__.py
4ed51c3
+++ b/pyrpkg/__init__.py
4ed51c3
@@ -3133,9 +3133,11 @@ class Commands(object):
4ed51c3
 
4ed51c3
             scratch = opts.get('scratch')
4ed51c3
             arches = opts.get('arches')
4ed51c3
+            isolated = opts.get('isolated')
4ed51c3
             if arches:
4ed51c3
-                if not scratch:
4ed51c3
-                    raise rpkgError('Cannot override arches for non-scratch builds')
4ed51c3
+                if not (scratch or isolated):
4ed51c3
+                    raise rpkgError('Cannot override arches for non-scratch and non-isolated '
4ed51c3
+                                    'builds')
4ed51c3
                 task_opts['arch_override'] = ' '.join(arches)
4ed51c3
 
4ed51c3
             if flatpak:
4ed51c3
diff --git a/pyrpkg/cli.py b/pyrpkg/cli.py
4ed51c3
index 0036136..eb17284 100644
4ed51c3
--- a/pyrpkg/cli.py
4ed51c3
+++ b/pyrpkg/cli.py
4ed51c3
@@ -1566,7 +1566,7 @@ see API KEY section of copr-cli(1) man page.
4ed51c3
             '--arches',
4ed51c3
             action='store',
4ed51c3
             nargs='*',
4ed51c3
-            help='Limit a scratch build to an arch. May have multiple arches.')
4ed51c3
+            help='Limit a scratch or a isolated build to an arch. May have multiple arches.')
4ed51c3
 
4ed51c3
         parser.add_argument(
4ed51c3
             '--skip-remote-rules-validation',
4ed51c3
@@ -2270,7 +2270,7 @@ see API KEY section of copr-cli(1) man page.
4ed51c3
             build_id, auth_method, oidc_id_provider, oidc_client_id,
4ed51c3
             oidc_client_secret, oidc_scopes)
4ed51c3
         if not self.args.q:
4ed51c3
-                print('The module build #{0} was cancelled'.format(build_id))
4ed51c3
+            print('The module build #{0} was cancelled'.format(build_id))
4ed51c3
 
4ed51c3
     def module_build_info(self):
4ed51c3
         """Show information about an MBS build"""
4ed51c3
-- 
4ed51c3
2.21.0
4ed51c3