Add colour to the health status output
This commit is contained in:
parent
e7129f0158
commit
d5a120f490
|
@ -176,10 +176,15 @@ def format_info(cluster_information, oformat):
|
||||||
return
|
return
|
||||||
|
|
||||||
# Plain formatting, i.e. human-readable
|
# Plain formatting, i.e. human-readable
|
||||||
|
if cluster_information['health'] == 'Optimal':
|
||||||
|
health_colour = ansiprint.green()
|
||||||
|
else:
|
||||||
|
health_colour = ansiprint.yellow()
|
||||||
|
|
||||||
ainformation = []
|
ainformation = []
|
||||||
ainformation.append('{}PVC cluster status:{}'.format(ansiprint.bold(), ansiprint.end()))
|
ainformation.append('{}PVC cluster status:{}'.format(ansiprint.bold(), ansiprint.end()))
|
||||||
ainformation.append('')
|
ainformation.append('')
|
||||||
ainformation.append('{}Cluster health:{} {}'.format(ansiprint.purple(), ansiprint.end(), cluster_information['health']))
|
ainformation.append('{}Cluster health:{} {}{}{}'.format(ansiprint.purple(), ansiprint.end(), health_colour, cluster_information['health'], ansiprint.end()))
|
||||||
ainformation.append('{}Primary node:{} {}'.format(ansiprint.purple(), ansiprint.end(), cluster_information['primary_node']))
|
ainformation.append('{}Primary node:{} {}'.format(ansiprint.purple(), ansiprint.end(), cluster_information['primary_node']))
|
||||||
ainformation.append('{}Cluster upstream IP:{} {}'.format(ansiprint.purple(), ansiprint.end(), cluster_information['upstream_ip']))
|
ainformation.append('{}Cluster upstream IP:{} {}'.format(ansiprint.purple(), ansiprint.end(), cluster_information['upstream_ip']))
|
||||||
ainformation.append('')
|
ainformation.append('')
|
||||||
|
|
Loading…
Reference in New Issue