From 401352998ca699b09639ca549c26a805dde6e8f5 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Tue, 26 Jun 2018 14:35:23 -0400 Subject: [PATCH] Correctly show the error on non-leader When non-leader tries to invite, print the error rather than unhelpful exception with no helpful data. --- confluent_server/bin/confluentutil | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/confluent_server/bin/confluentutil b/confluent_server/bin/confluentutil index bf68a552..c7f9b56d 100644 --- a/confluent_server/bin/confluentutil +++ b/confluent_server/bin/confluentutil @@ -41,8 +41,11 @@ def show_invitation(name): make_certificate() s = client.Command().connection tlvdata.send(s, {'collective': {'operation': 'invite', 'name': name}}) - invite = tlvdata.recv(s)['collective']['invitation'] - print ('Invitatation for {0}: {1}'.format(name, invite)) + invite = tlvdata.recv(s)['collective'] + if 'error' in invite: + sys.stderr.write(invite['error'] + '\n') + return + print ('Invitatation for {0}: {1}'.format(name, invite['invitation'])) def join_collective(server, invitation):