From 2f616d4586df522df7834aada87ff84e149ca073 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Wed, 3 Oct 2018 16:23:20 -0400 Subject: [PATCH] Better error when collective.manager is set to something invalid If the collective.manager field does not correspond to any collective manager, give a useful error rather than unexpected error. --- confluent_server/confluent/core.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/confluent_server/confluent/core.py b/confluent_server/confluent/core.py index bb0fb72b..cc469661 100644 --- a/confluent_server/confluent/core.py +++ b/confluent_server/confluent/core.py @@ -859,8 +859,16 @@ def dispatch_request(nodes, manager, element, configmanager, inputdata, certfile='/etc/confluent/srvcert.pem') except Exception: for node in nodes: - yield msg.ConfluentResourceUnavailable( - node, 'Collective member {0} is unreachable'.format(a['name'])) + if a: + yield msg.ConfluentResourceUnavailable( + node, 'Collective member {0} is unreachable'.format( + a['name'])) + else: + yield msg.ConfluentResourceUnavailable( + node, + '"{0}" is not recognized as a collective member'.format( + manager)) + return if not util.cert_matches(a['fingerprint'], remote.getpeercert( binary_form=True)):