Merge "deploy element: Call find_disk in loop w/ timeout."
This commit is contained in:
commit
207aeced03
1 changed files with 16 additions and 2 deletions
|
@ -4,11 +4,25 @@ if [ -z "$ISCSI_TARGET_IQN" ]; then
|
|||
bash
|
||||
fi
|
||||
|
||||
target_disk=`find_disk "$DISK"`
|
||||
t=0
|
||||
while ! target_disk=$(find_disk "$DISK"); do
|
||||
if [ $t -eq 10 ]; then
|
||||
break
|
||||
fi
|
||||
t=$(($t + 1))
|
||||
sleep 1
|
||||
done
|
||||
|
||||
if [ -z "$target_disk" ]; then
|
||||
echo "Could not find disk to use."
|
||||
echo "Starting troubleshooting shell."
|
||||
bash
|
||||
fi
|
||||
|
||||
echo "start iSCSI target on $target_disk"
|
||||
start_iscsi_target "$ISCSI_TARGET_IQN" "$target_disk" ALL
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Could not find disk to use."
|
||||
echo "Failed to start iscsi target."
|
||||
echo "Starting troubleshooting shell."
|
||||
bash
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue