瀏覽代碼

raise AosVersionException if no expected packages found by dnf query

Signed-off-by: Adam Miller <maxamillion@fedoraproject.org>
Adam Miller 7 年之前
父節點
當前提交
a294ee21e8
共有 1 個文件被更改,包括 8 次插入0 次删除
  1. 8 0
      roles/openshift_health_checker/library/aos_version.py

+ 8 - 0
roles/openshift_health_checker/library/aos_version.py

@@ -130,6 +130,14 @@ def _retrieve_available_packages(expected_pkgs):
 
         pkgs = list(aquery.filter(name=expected_pkgs))
 
+        if not pkgs:
+            # pkgs list is empty, raise because no expected packages found
+            raise AosVersionException('\n'.join([
+                'Unable to find any OpenShift packages.',
+                'Check your subscription and repo settings.',
+                str(excinfo),
+            ]))
+
     return pkgs