diff --git a/confluent_server/confluent/collective/manager.py b/confluent_server/confluent/collective/manager.py index e457da4d..7539fcc0 100644 --- a/confluent_server/confluent/collective/manager.py +++ b/confluent_server/confluent/collective/manager.py @@ -17,6 +17,7 @@ import base64 import confluent.collective.invites as invites import confluent.config.configmanager as cfm +import confluent.exceptions as exc import confluent.tlvdata as tlvdata import confluent.util as util import eventlet @@ -140,6 +141,13 @@ def handle_connection(connection, cert, request, local=False): {'error': 'Invite can only be run from current ' 'leader ({0})'.format(currentleader)}}) return + try: + cfm.check_quorum() + except exc.DegradedCollective: + tlvdata.send(connection, + {'collective': + {'error': 'Collective does not have quorum'}) + return #TODO(jjohnson2): Cannot do the invitation if not the head node, the certificate hand-carrying #can't work in such a case. name = request['name']