2
0
mirror of https://github.com/xcat2/confluent.git synced 2025-02-10 15:55:27 +00:00

Have collective show present some info when not in quorum

This commit is contained in:
Jarrod Johnson 2018-07-20 13:54:05 -04:00
parent 5cf1671350
commit f0edbbad39
2 changed files with 7 additions and 7 deletions

View File

@ -77,6 +77,8 @@ def show_collective():
if 'error' in res['collective']:
print(res['collective']['error'])
return
if 'quorum' in res['collective']:
print('Quorum: {0}'.format(res['collective']['quorum']))
print('Leader: {0}'.format(res['collective']['leader']))
if 'active' in res['collective']:
if res['collective']['active']:

View File

@ -185,13 +185,6 @@ def handle_connection(connection, cert, request, local=False):
'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:
linfo = cfm.get_collective_member_by_address(currentleader)
remote = socket.create_connection((currentleader, 13001))
@ -217,6 +210,11 @@ def handle_connection(connection, cert, request, local=False):
else:
collinfo = {}
populate_collinfo(collinfo)
try:
cfm.check_quorum()
collinfo['quorum'] = True
except exc.DegradedCollective:
collinfo['quorum'] = False
tlvdata.send(connection, {'collective': collinfo})
return
if 'invite' == operation: