fix defect #4616 On rhels7.x env, stateful node status will be failed duo to privision nic is not ready when run postscript

This commit is contained in:
immarvin 2015-03-25 03:47:05 -07:00
parent 28e6939268
commit 719c6d0de3

View File

@ -12,11 +12,12 @@ fi
SLI=$(awk 'BEGIN{srand(); printf("%d\n",rand()*10)}')
sleep $SLI
MACADDR=`grep MACADDRESS= /xcatpost/mypostscript.post |awk -F = '{print $2}'|sed s/\'//g`
INSTALLNIC=`ip -o link|grep -i $MACADDR|awk '{print $2}'|sed s/://`
#the nics have not been configured when running the PBS sometimes, need to make sure...
RETRY=0
until ip -4 --oneline addr show|grep -v 127.0.0.1 >/dev/null
until ip -4 --oneline addr show dev $INSTALLNIC|grep inet >/dev/null
do
sleep 2
RETRY=$[ $RETRY + 1 ]