Skip to content

Commit

Permalink
Drop quiet option of grep to avoid race condition with pipefail
Browse files Browse the repository at this point in the history
Signed-off-by: Guangwen Feng <fenggw-fnst@fujitsu.com>
  • Loading branch information
fenggw-fnst committed Jan 26, 2025
1 parent 6ae9e16 commit ba75723
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/ironic-common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ get_provisioning_interface()
local interface="provisioning"

if [[ -n "${PROVISIONING_IP}" ]]; then
if ip -br addr show | grep -qi " ${PROVISIONING_IP}/"; then
if ip -br addr show | grep -i " ${PROVISIONING_IP}/" &>/dev/null; then
interface="$(ip -br addr show | grep -i " ${PROVISIONING_IP}/" | cut -f 1 -d ' ' | cut -f 1 -d '@')"
fi
fi

for mac in ${PROVISIONING_MACS//,/ }; do
if ip -br link show up | grep -qi "$mac"; then
if ip -br link show up | grep -i "$mac" &>/dev/null; then
interface="$(ip -br link show up | grep -i "$mac" | cut -f 1 -d ' ' | cut -f 1 -d '@')"
break
fi
Expand Down

0 comments on commit ba75723

Please sign in to comment.