Users of KojiDownloader usually rely on architecture detection
to find an RPM package to download. In some cases, the package
the user is trying to find is actually architecture independent.

This patch adds another try with arch=noarch as a fallback when
the platform specific packages are not found.

Signed-off-by: Cleber Rosa <cr...@redhat.com>
---
 client/tests/kvm/kvm_utils.py |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/client/tests/kvm/kvm_utils.py b/client/tests/kvm/kvm_utils.py
index d8d3357..bb0ea36 100644
--- a/client/tests/kvm/kvm_utils.py
+++ b/client/tests/kvm/kvm_utils.py
@@ -1652,6 +1652,14 @@ class KojiDownloader(object):
 
         rpms = self.session.listRPMs(buildID=info['id'],
                                      arches=arch)
+
+        if not rpms:
+            logging.info("Attempting to find platform independent package "
+                         "(arch=noarch)")
+            arch = "noarch"
+            rpms = self.session.listRPMs(buildID=info['id'],
+                                         arches=arch)
+
         if not rpms:
             raise ValueError("No %s packages available for %s" %
                              arch, koji.buildLabel(info))
-- 
1.7.1

_______________________________________________
Autotest mailing list
Autotest@test.kernel.org
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest

Reply via email to