2
0
mirror of https://github.com/xcat2/confluent.git synced 2025-01-13 11:17:49 +00:00

Have collective show report when collective inactive

Collective show was misleading if not in a collective.
This commit is contained in:
Jarrod Johnson 2018-07-19 15:59:15 -04:00
parent a09792f969
commit f2f902de7b

View File

@ -178,12 +178,19 @@ def handle_connection(connection, cert, request, local=False):
return
if 'show' == operation:
if list(cfm.list_collective()) == 0:
tlvdata.send(connection,
{'collective': {'error': 'Collective mode not '
'enabled on this '
'system'}})
return
try:
cfm.check_quorum()
except exc.DegradedCollective:
tlvdata.send(connection,
{'collective':
{'error': 'Collective does not have quorum'}})
return
if follower:
myleader = cfm.get_collective_member_by_address(
currentleader)['name']