From fe258d9d565bb6f37c5985e469afae24dd90a42e Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Thu, 23 Feb 2023 10:19:18 -0500 Subject: [PATCH] Correct bad health text call for old clusters --- client-cli/pvc/cli_lib/cluster.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/client-cli/pvc/cli_lib/cluster.py b/client-cli/pvc/cli_lib/cluster.py index 3429b970..1aa13f55 100644 --- a/client-cli/pvc/cli_lib/cluster.py +++ b/client-cli/pvc/cli_lib/cluster.py @@ -141,7 +141,11 @@ def format_info(cluster_information, oformat): ) ainformation.append("") - health_text = f"{cluster_information['cluster_health']['health']}%" + health_text = ( + f"{cluster_information.get('cluster_health', {}).get('health', 'N/A')}" + ) + if health_text != "N/A": + health_text += "%" if cluster_information.get("maintenance") == "true": health_text += " (maintenance on)"