summaryrefslogtreecommitdiffstats
path: root/roles/openshift_health_checker/openshift_checks/memory_availability.py
diff options
context:
space:
mode:
authorjuanvallejo <jvallejo@redhat.com>2017-04-07 18:37:14 -0400
committerjuanvallejo <jvallejo@redhat.com>2017-04-17 13:29:23 -0400
commit58fdef2696f7f1f0c6f3b5aa404427a2fc5a00f2 (patch)
tree60271345b7b63bfee9939006952d22f4231290c9 /roles/openshift_health_checker/openshift_checks/memory_availability.py
parentd2955189066364461a846e0e34d344c94b26a16b (diff)
downloadopenshift-58fdef2696f7f1f0c6f3b5aa404427a2fc5a00f2.tar.gz
openshift-58fdef2696f7f1f0c6f3b5aa404427a2fc5a00f2.tar.bz2
openshift-58fdef2696f7f1f0c6f3b5aa404427a2fc5a00f2.tar.xz
openshift-58fdef2696f7f1f0c6f3b5aa404427a2fc5a00f2.zip
add disk and memory availability check tests
Diffstat (limited to 'roles/openshift_health_checker/openshift_checks/memory_availability.py')
-rw-r--r--roles/openshift_health_checker/openshift_checks/memory_availability.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/roles/openshift_health_checker/openshift_checks/memory_availability.py b/roles/openshift_health_checker/openshift_checks/memory_availability.py
index aa54b9535..b1629aa89 100644
--- a/roles/openshift_health_checker/openshift_checks/memory_availability.py
+++ b/roles/openshift_health_checker/openshift_checks/memory_availability.py
@@ -1,5 +1,5 @@
# pylint: disable=missing-docstring
-from openshift_checks import OpenShiftCheck, get_var
+from openshift_checks import OpenShiftCheck, OpenShiftCheckException, get_var
class MemoryAvailability(OpenShiftCheck):
@@ -26,6 +26,9 @@ class MemoryAvailability(OpenShiftCheck):
total_memory = get_var(task_vars, "ansible_memtotal_mb")
recommended_memory_mb = max(self.recommended_memory_mb.get(group, 0) for group in group_names)
+ if not recommended_memory_mb:
+ msg = "Unable to determine recommended memory size for group_name {group_name}"
+ raise OpenShiftCheckException(msg.format(group_name=group_names))
if total_memory < recommended_memory_mb:
msg = ("Available memory ({available} MB) below recommended storage. "