Correct bad health text call for old clusters

This commit is contained in:
Joshua Boniface 2023-02-23 10:19:18 -05:00
parent 93d89a2414
commit fe258d9d56
1 changed files with 5 additions and 1 deletions

View File

@ -141,7 +141,11 @@ def format_info(cluster_information, oformat):
) )
ainformation.append("") 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": if cluster_information.get("maintenance") == "true":
health_text += " (maintenance on)" health_text += " (maintenance on)"