From f2f902de7b77a1df77a8543bde7a64c944a8eaae Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Thu, 19 Jul 2018 15:59:15 -0400 Subject: [PATCH] Have collective show report when collective inactive Collective show was misleading if not in a collective. --- confluent_server/confluent/collective/manager.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/confluent_server/confluent/collective/manager.py b/confluent_server/confluent/collective/manager.py index 1c6d118e..c6723d84 100644 --- a/confluent_server/confluent/collective/manager.py +++ b/confluent_server/confluent/collective/manager.py @@ -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']