From e7b93dba50a0582414864a8d39b5f5dc152f5a9c Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Fri, 19 Jun 2020 07:29:14 -0400 Subject: [PATCH] Have apiclient use first rather than last apiclient was preferring the slowest rather than the fastest respondant, inconsistent with intent and everything else. --- confluent_osdeploy/esxi7/initramfs/opt/confluent/bin/apiclient | 3 ++- confluent_osdeploy/rhvh4/initramfs/opt/confluent/bin/apiclient | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/confluent_osdeploy/esxi7/initramfs/opt/confluent/bin/apiclient b/confluent_osdeploy/esxi7/initramfs/opt/confluent/bin/apiclient index 9c64e88e..182ba7b5 100644 --- a/confluent_osdeploy/esxi7/initramfs/opt/confluent/bin/apiclient +++ b/confluent_osdeploy/esxi7/initramfs/opt/confluent/bin/apiclient @@ -8,11 +8,12 @@ class HTTPSClient(client.HTTPConnection, object): def __init__(self, port=443): self.stdheaders = {} info = open('/etc/confluent/confluent.info').read().split('\n') + host = None for line in info: if line.startswith('NODENAME:'): node = line.split(' ')[1] self.stdheaders['CONFLUENT_NODENAME'] = node - if line.startswith('MANAGER:'): + if line.startswith('MANAGER:') and not host: host = line.split(' ')[1] self.stdheaders['CONFLUENT_APIKEY'] = open('/etc/confluent/confluent.apikey').read().strip() client.HTTPConnection.__init__(self, host, port) diff --git a/confluent_osdeploy/rhvh4/initramfs/opt/confluent/bin/apiclient b/confluent_osdeploy/rhvh4/initramfs/opt/confluent/bin/apiclient index df1ea217..4e285446 100644 --- a/confluent_osdeploy/rhvh4/initramfs/opt/confluent/bin/apiclient +++ b/confluent_osdeploy/rhvh4/initramfs/opt/confluent/bin/apiclient @@ -8,11 +8,12 @@ class HTTPSClient(client.HTTPConnection, object): def __init__(self, port=443): self.stdheaders = {} info = open('/etc/confluent/confluent.info').read().split('\n') + host = None for line in info: if line.startswith('NODENAME:'): node = line.split(' ')[1] self.stdheaders['CONFLUENT_NODENAME'] = node - if line.startswith('MANAGER:'): + if line.startswith('MANAGER:') and not host: host = line.split(' ')[1] self.stdheaders['CONFLUENT_APIKEY'] = open('/etc/confluent/confluent.apikey').read().strip() client.HTTPConnection.__init__(self, host, port)