mirror of
https://github.com/xcat2/confluent.git
synced 2025-02-28 08:11:45 +00:00
Use the scan_confluent for getting apikey, if relevant
This commit is contained in:
parent
484a3f8c64
commit
8a01a0bbdc
@ -175,9 +175,21 @@ def get_apikey(nodename, mgr, mgr6=None):
|
||||
hosts.append(host)
|
||||
while not apikey:
|
||||
for host in hosts:
|
||||
apikey = get_net_apikey(nodename, host)
|
||||
try:
|
||||
apikey = get_net_apikey(nodename, host)
|
||||
except OSError:
|
||||
apikey = None
|
||||
if apikey:
|
||||
break
|
||||
else:
|
||||
srvlist, _ = scan_confluents()
|
||||
for host in srvlist:
|
||||
try:
|
||||
apikey = get_net_apikey(nodename, host)
|
||||
except OSError:
|
||||
apikey = None
|
||||
if apikey:
|
||||
break
|
||||
if not apikey:
|
||||
sys.stderr.write(
|
||||
"Failed getting API token, check deployment.apiarmed attribute on {}\n".format(nodename))
|
||||
|
Loading…
x
Reference in New Issue
Block a user