Disallow health less than 0
This commit is contained in:
		| @@ -155,6 +155,9 @@ def getClusterHealth(zkhandler, node_list, vm_list, ceph_osd_list): | |||||||
|     elif ceph_health_status == "HEALTH_WARN": |     elif ceph_health_status == "HEALTH_WARN": | ||||||
|         cluster_health -= health_delta_map["ceph_warn"] |         cluster_health -= health_delta_map["ceph_warn"] | ||||||
|  |  | ||||||
|  |     if cluster_health < 0: | ||||||
|  |         cluster_health = 0 | ||||||
|  |  | ||||||
|     return cluster_health, messages |     return cluster_health, messages | ||||||
|  |  | ||||||
|  |  | ||||||
|   | |||||||
| @@ -366,6 +366,9 @@ class MonitoringInstance(object): | |||||||
|             if result is not None: |             if result is not None: | ||||||
|                 total_health -= result.health_delta |                 total_health -= result.health_delta | ||||||
|  |  | ||||||
|  |         if total_health < 0: | ||||||
|  |             total_health = 0 | ||||||
|  |  | ||||||
|         if total_health > 90: |         if total_health > 90: | ||||||
|             health_colour = self.logger.fmt_green |             health_colour = self.logger.fmt_green | ||||||
|         elif total_health > 50: |         elif total_health > 50: | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user