2
0
mirror of https://github.com/xcat2/confluent.git synced 2025-02-26 15:21:18 +00:00

Modify apiclient to rewrite ifidx if stale

This commit is contained in:
Jarrod Johnson 2020-08-11 15:41:44 -04:00
parent 32fe6b2fff
commit 4cd7714099
2 changed files with 3 additions and 2 deletions

View File

@ -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)

View File

@ -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