Better handle N/A health from old versions
This commit is contained in:
parent
fe258d9d56
commit
765f0ef13d
|
@ -125,7 +125,10 @@ def format_info(cluster_information, oformat):
|
||||||
return json.dumps(cluster_information, indent=4)
|
return json.dumps(cluster_information, indent=4)
|
||||||
|
|
||||||
# Plain formatting, i.e. human-readable
|
# Plain formatting, i.e. human-readable
|
||||||
if cluster_information.get("maintenance") == "true":
|
if (
|
||||||
|
cluster_information.get("maintenance") == "true"
|
||||||
|
or cluster_information.get("cluster_health", {}).get("health", "N/A") == "N/A"
|
||||||
|
):
|
||||||
health_colour = ansiprint.blue()
|
health_colour = ansiprint.blue()
|
||||||
elif cluster_information.get("cluster_health", {}).get("health", 100) > 90:
|
elif cluster_information.get("cluster_health", {}).get("health", 100) > 90:
|
||||||
health_colour = ansiprint.green()
|
health_colour = ansiprint.green()
|
||||||
|
|
Loading…
Reference in New Issue