From 4cd77140991a99a5285721a6c51d57d641a7a028 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Tue, 11 Aug 2020 15:41:44 -0400 Subject: [PATCH] Modify apiclient to rewrite ifidx if stale --- confluent_osdeploy/common/opt/confluent/bin/apiclient | 2 +- .../genesis/initramfs/opt/confluent/bin/rungenesis | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/confluent_osdeploy/common/opt/confluent/bin/apiclient b/confluent_osdeploy/common/opt/confluent/bin/apiclient index bee4cbaf..5eeceabf 100644 --- a/confluent_osdeploy/common/opt/confluent/bin/apiclient +++ b/confluent_osdeploy/common/opt/confluent/bin/apiclient @@ -41,7 +41,7 @@ class HTTPSClient(client.HTTPConnection, object): host, mgtiface, havedefault = extinfo[:3] if havedefault == '0' and extinfo[2] == '1': host, mgtiface, havedefault = extinfo[:3] - if not os.path.exists('/tmp/confluent.ifidx') and '%' in host: + if '%' in host: ifidx = host.split('%', 1)[1] with open('/tmp/confluent.ifidx', 'w+') as ifout: ifout.write(ifidx) diff --git a/confluent_osdeploy/genesis/initramfs/opt/confluent/bin/rungenesis b/confluent_osdeploy/genesis/initramfs/opt/confluent/bin/rungenesis index b0d85830..9b7b9ae7 100644 --- a/confluent_osdeploy/genesis/initramfs/opt/confluent/bin/rungenesis +++ b/confluent_osdeploy/genesis/initramfs/opt/confluent/bin/rungenesis @@ -34,14 +34,15 @@ fi (ssh-keygen -A; /usr/sbin/sshd) & TRIES=0 touch /etc/confluent/confluent.info +cd /sys/class/net while ! grep ^EXTMGRINFO: /etc/confluent/confluent.info | awk -F'|' '{print $3}' | grep 1 >& /dev/null && [ "$TRIES" -lt 15 ]; do TRIES=$((TRIES + 1)) - cd /sys/class/net for i in *; do ip link set $i up done /opt/confluent/bin/copernicus -t > /etc/confluent/confluent.info done +cd / ip addr|grep inet |awk '{print $2}' | sed -e 's!/.*!!' nodename=$(grep ^NODENAME /etc/confluent/confluent.info|awk '{print $2}') hostname $nodename