From 765f0ef13d7d58cb6e92f38da1f2a0896c881e5b Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Thu, 23 Feb 2023 10:22:00 -0500 Subject: [PATCH] Better handle N/A health from old versions --- client-cli/pvc/cli_lib/cluster.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/client-cli/pvc/cli_lib/cluster.py b/client-cli/pvc/cli_lib/cluster.py index 1aa13f55..eb88ea87 100644 --- a/client-cli/pvc/cli_lib/cluster.py +++ b/client-cli/pvc/cli_lib/cluster.py @@ -125,7 +125,10 @@ def format_info(cluster_information, oformat): return json.dumps(cluster_information, indent=4) # 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() elif cluster_information.get("cluster_health", {}).get("health", 100) > 90: health_colour = ansiprint.green()