2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-07-31 10:09:40 +00:00

Merge pull request #7634 from VersatusHPC/harvest/rcons-resolve-conserver

fix(rcons): resolve a conserver hostname before the local-address check
This commit is contained in:
Daniel Hilst
2026-07-24 12:04:15 -03:00
committed by GitHub
+5
View File
@@ -115,6 +115,11 @@ if [ $USE_CONFLUENT == "1" ] && ([ -x "/opt/confluent/bin/confetty" ] || [ -x "/
fi
if [ -z "$CONSERVER" ]; then
CONSERVER=`nodels $1 nodehm.conserver 2>/dev/null | awk -F: '{print $2}' | tr -d ' '`
# nodehm.conserver may be a hostname; resolve it so the local-address
# comparison below matches when the conserver is this host.
if [ ! -z "$CONSERVER" ]; then
CONSERVER=$(getent hosts $CONSERVER | awk '{print $1}')
fi
declare -a ipaddrs=`ip -o a | awk {'print $4'} | cut -d/ -f1 | grep -v : | tr '\n' ' '`
for IP in ${ipaddrs[*]}; do
if [[ "${CONSERVER}" == "${IP}" ]]; then