Compare commits

..

1 Commits

Author SHA256 Message Date
66c168cce4 Fix a few ShellCheck reported warnings from PR #213
Some checks failed
Check Release Manifest Local Charts Versions / Check Release Manifest Local Charts Versions (pull_request) Successful in 10s
Build PR in OBS / Build PR in OBS (pull_request_target) Failing after 3h13m34s
The checks on the upstream project have reported some warnings to the
code accepted in PR #213, fix them in this commit.

Signed-off-by: Marco Chiappero <marco.chiappero@suse.com>
2025-08-07 14:28:58 +00:00
2 changed files with 13 additions and 13 deletions

View File

@@ -53,7 +53,7 @@ wait_for_interface_or_ip
if [[ "$(echo "$LISTEN_ALL_INTERFACES" | tr '[:upper:]' '[:lower:]')" == "true" ]]; then
export IRONIC_HOST_IP="::"
elif [[ -n "$ENABLE_IPV6" ]]; then
elif [[ -n "${ENABLE_IPV6}" ]]; then
export IRONIC_HOST_IP="$IRONIC_IPV6"
else
export IRONIC_HOST_IP="$IRONIC_IP"

View File

@@ -55,7 +55,7 @@ get_ip_of_hostname()
local HOSTNAME=$1
echo $(nslookup -type=${QUERY} "$HOSTNAME" | tail -n2 | grep -w "Address:" | cut -d " " -f2)
echo $(nslookup -type=${QUERY} "${HOSTNAME}" | tail -n2 | grep -w "Address:" | cut -d " " -f2)
}
get_interface_of_ip()
@@ -85,7 +85,7 @@ get_interface_of_ip()
# For IPv6 addresses, this will give the short-form address
IP_ADDR="$(ipcalc "${IP_ADDR}" | grep "^Address:" | awk '{print $2}')"
echo $(ip "$IP_VERS" -br addr show scope global | grep -i " ${IP_ADDR}/" | cut -f 1 -d ' ' | cut -f 1 -d '@')
echo $(ip "${IP_VERS}" -br addr show scope global | grep -i " ${IP_ADDR}/" | cut -f 1 -d ' ' | cut -f 1 -d '@')
}
get_ip_of_interface()
@@ -111,7 +111,7 @@ get_ip_of_interface()
local IFACE=$1
echo $(ip "$IP_VERS" -br addr show scope global up dev $IFACE | awk '{print $3}' | sed -e 's%/.*%%' | head -n 1)
echo $(ip "${IP_VERS}" -br addr show scope global up dev ${IFACE} | awk '{print $3}' | sed -e 's%/.*%%' | head -n 1)
}
get_provisioning_interface()
@@ -150,7 +150,7 @@ wait_for_interface_or_ip()
until [[ -n "$IFACE_OF_IP" ]]; do
echo "Waiting for ${PROVISIONING_IP} to be configured on an interface..."
IFACE_OF_IP="$(get_interface_of_ip "$PROVISIONING_IP")"
IFACE_OF_IP="$(get_interface_of_ip "${PROVISIONING_IP}")"
sleep 1
done
@@ -167,10 +167,10 @@ wait_for_interface_or_ip()
until [[ -n "$IRONIC_IPV6" ]] || [[ -n "$IRONIC_IP" ]]; do
echo "Waiting for ${PROVISIONING_INTERFACE} interface to be configured..."
IRONIC_IPV6="$(get_ip_of_interface "$PROVISIONING_INTERFACE" 6)"
IRONIC_IPV6="$(get_ip_of_interface "${PROVISIONING_INTERFACE}" 6)"
sleep 1
IRONIC_IP="$(get_ip_of_interface "$PROVISIONING_INTERFACE" 4)"
IRONIC_IP="$(get_ip_of_interface "${PROVISIONING_INTERFACE}" 4)"
sleep 1
done
@@ -191,21 +191,21 @@ wait_for_interface_or_ip()
local IPV6_RECORD=""
local IPV4_RECORD=""
IPV6_RECORD="$(get_ip_of_hostname "$IRONIC_URL_HOSTNAME" 6)"
IPV4_RECORD="$(get_ip_of_hostname "$IRONIC_URL_HOSTNAME" 4)"
IPV6_RECORD="$(get_ip_of_hostname "${IRONIC_URL_HOSTNAME}" 6)"
IPV4_RECORD="$(get_ip_of_hostname "${IRONIC_URL_HOSTNAME}" 4)"
# We couldn't get any IP
if [[ -z "$IPV4_RECORD" ]] && [[ -z "$IPV6_RECORD" ]]; then
echo "${FUNCNAME}: no valid IP found for hostname $IRONIC_URL_HOSTNAME" >&2
echo "${FUNCNAME}: no valid IP found for hostname ${IRONIC_URL_HOSTNAME}" >&2
return 1
fi
echo "Waiting for ${IPV6_RECORD} to be configured on an interface"
IPV6_IFACE="$(get_interface_of_ip "$IPV6_RECORD" 6)"
IPV6_IFACE="$(get_interface_of_ip "${IPV6_RECORD}" 6)"
sleep 1
echo "Waiting for ${IPV4_RECORD} to be configured on an interface"
IPV4_IFACE="$(get_interface_of_ip "$IPV4_RECORD" 4)"
IPV4_IFACE="$(get_interface_of_ip "${IPV4_RECORD}" 4)"
sleep 1
done
@@ -238,7 +238,7 @@ wait_for_interface_or_ip()
fi
if [[ -n "$IRONIC_IPV6" ]]; then
export ENABLE_IPV6=yes
export IRONIC_URL_HOST="[$IRONIC_IPV6]" # The HTTP host needs surrounding with brackets
export IRONIC_URL_HOST="[${IRONIC_IPV6}]" # The HTTP host needs surrounding with brackets
fi
# Once determined if we have IPv4 and/or IPv6, override the hostname if provided