Skip to content

Commit

Permalink
fix(iscsi): do not exit in handle_netroot() if discovery failed
Browse files Browse the repository at this point in the history
User may specify multiple netroot in cmdline, failed to connect one netroot
do not mean all netroot are not accessible. So if one netroot failed, do
not exit the discovery and login flow.

Signed-off-by: Wenchao Hao <[email protected]>

(Cherry-picked commit: 319dc7fe10585a19d1a051f8ad1ba0190f86ff1f)

Resolves: RHEL-11779
  • Loading branch information
Wenchao Hao authored and pvalena committed Oct 25, 2023
1 parent 883ad44 commit 2dc21d8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules.d/95iscsi/iscsiroot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ handle_netroot()
fi

targets=$(iscsiadm -m discovery -t st -p $iscsi_target_ip:${iscsi_target_port:+$iscsi_target_port} | sed 's/^.*iqn/iqn/')
[ -z "$targets" ] && echo "Target discovery to $iscsi_target_ip:${iscsi_target_port:+$iscsi_target_port} failed with status $?" && exit 1
[ -z "$targets" ] && echo "Target discovery to $iscsi_target_ip:${iscsi_target_port:+$iscsi_target_port} failed with status $?" && return 1

found=
for target in $targets; do
Expand Down

0 comments on commit 2dc21d8

Please sign in to comment.