From 7a9276300a26a4058c2a6fafdbfdb6e50f795b90 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Wed, 9 Dec 2020 16:20:02 -0500 Subject: [PATCH] Have apiclient reach out to deploycfg server If we already have deploycfg, use that to indicate the target server rather than copernicus data. --- confluent_osdeploy/common/opt/confluent/bin/apiclient | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/confluent_osdeploy/common/opt/confluent/bin/apiclient b/confluent_osdeploy/common/opt/confluent/bin/apiclient index 5e8c418a..f9997004 100644 --- a/confluent_osdeploy/common/opt/confluent/bin/apiclient +++ b/confluent_osdeploy/common/opt/confluent/bin/apiclient @@ -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