2
0
mirror of https://github.com/xcat2/confluent.git synced 2025-01-29 12:27:40 +00:00

Have apiclient reach out to deploycfg server

If we already have deploycfg, use that to indicate the
target server rather than copernicus data.
This commit is contained in:
Jarrod Johnson 2020-12-09 16:20:02 -05:00
parent 87ef68e26a
commit 7a9276300a

View File

@ -66,6 +66,15 @@ class HTTPSClient(client.HTTPConnection, object):
ifout.write(ifidx)
if json:
self.stdheaders['ACCEPT'] = 'application/json'
try:
info = open('/etc/confluent/confluent.deploycfg').read().split('\n')
except Exception:
info = None
if info:
for line in info:
if line.startswith('deploy_server: '):
host = line.split(': ', 1)[1]
break
self.stdheaders['CONFLUENT_APIKEY'] = get_apikey(node, host)
if mgtiface:
self.stdheaders['CONFLUENT_MGTIFACE'] = mgtiface