From 58fdef2696f7f1f0c6f3b5aa404427a2fc5a00f2 Mon Sep 17 00:00:00 2001 From: juanvallejo Date: Fri, 7 Apr 2017 18:37:14 -0400 Subject: add disk and memory availability check tests --- .../openshift_health_checker/openshift_checks/memory_availability.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'roles/openshift_health_checker/openshift_checks/memory_availability.py') 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. " -- cgit v1.2.3