From 484dbd9f74f0c6d507a2064b8b803e7b9a66df49 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Fri, 23 Sep 2022 16:10:55 -0400 Subject: [PATCH] Fix default interface detection --- .../initramfs/opt/confluent/bin/apiclient | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/confluent_osdeploy/common/initramfs/opt/confluent/bin/apiclient b/confluent_osdeploy/common/initramfs/opt/confluent/bin/apiclient index 67b53237..94178acc 100644 --- a/confluent_osdeploy/common/initramfs/opt/confluent/bin/apiclient +++ b/confluent_osdeploy/common/initramfs/opt/confluent/bin/apiclient @@ -259,12 +259,17 @@ class HTTPSClient(client.HTTPConnection, object): host, mgtiface, havedefault = extinfo[:3] if havedefault == '0' and extinfo[2] == '1': host, mgtiface, havedefault = extinfo[:3] - if '%' in host: - ifidx = host.split('%', 1)[1] - with open('/tmp/confluent.ifidx', 'w+') as ifout: - ifout.write(ifidx) - if host: - self.hosts.append(host) + if '%' in host: + ifidx = host.split('%', 1)[1] + with open('/tmp/confluent.ifidx', 'w+') as ifout: + ifout.write(ifidx) + if host: + if havedefault == '0': + if '%' in host: + ifidx = host.split('%', 1)[1] + with open('/tmp/confluent.ifidx', 'w+') as ifout: + ifout.write(ifidx) + self.hosts.append(host) try: info = open('/etc/confluent/confluent.deploycfg').read().split('\n') except Exception: