2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-11-25 11:01:09 +00:00

Auto-make certificate if missing

Automatically fix a missing certificate if this is the case.
This commit is contained in:
Jarrod Johnson 2018-06-19 11:05:38 -04:00
parent 810be71720
commit 38898ca921

View File

@ -37,6 +37,8 @@ def make_certificate():
def show_invitation(name):
if not os.path.exists('/etc/confluent/srvcert.pem'):
make_certificate()
s = client.Command().connection
tlvdata.send(s, {'collective': {'operation': 'invite', 'name': name}})
invite = tlvdata.recv(s)['collective']['invitation']
@ -44,6 +46,8 @@ def show_invitation(name):
def join_collective(server, invitation):
if not os.path.exists('/etc/confluent/srvcert.pem'):
make_certificate()
s = client.Command().connection
while not invitation:
invitation = raw_input('Paste the invitation here: ')