mirror of
https://github.com/xcat2/confluent.git
synced 2024-11-22 09:32:21 +00:00
Correctly show the error on non-leader
When non-leader tries to invite, print the error rather than unhelpful exception with no helpful data.
This commit is contained in:
parent
9eeede651e
commit
401352998c
@ -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):
|
||||
|
Loading…
Reference in New Issue
Block a user