diff --git a/xCAT-genesis-scripts/bin/doxcat b/xCAT-genesis-scripts/bin/doxcat index 2820e48be..7d6203531 100755 --- a/xCAT-genesis-scripts/bin/doxcat +++ b/xCAT-genesis-scripts/bin/doxcat @@ -146,10 +146,24 @@ if [[ -n $hostip && -n $netmask && -n $gateway && -n $bootnic ]]; then else echo "Setting IP via DHCP..." # This section is for System P hardware discovery, which won't have a BOOTIF value set + tries=0 + while [ $tries -lt 5 ]; do + if [ -z "$bootnic" ]; then + ALLUP_NICS=`ip link show | grep -v "^ " | grep "state UP" | awk '{print $2}' | sed -e 's/:$//'|grep -v lo` + for tmp1 in $ALLUP_NICS; do + bootnic=$tmp1 + break + done + else + break + fi + sleep 2 + tries=$(($tries+1)) + done if [ -z "$bootnic" ]; then - ALLUP_NICS=`ip link show | grep -v "^ " | grep "state UP" | awk '{print $2}' | sed -e 's/:$//'|grep -v lo` - for tmp1 in $ALLUP_NICS; do - bootnic=$tmp1 + ALL_NICS=`ip link show | grep -v "^ " | awk '{print $2}' | sed -e 's/:$//' | grep -v lo` + for tmp in $ALL_NICS; do + bootnic=$tmp break done fi diff --git a/xCAT-server/lib/xcat/plugins/nodediscover.pm b/xCAT-server/lib/xcat/plugins/nodediscover.pm index d8b3c1c32..4dd348e36 100644 --- a/xCAT-server/lib/xcat/plugins/nodediscover.pm +++ b/xCAT-server/lib/xcat/plugins/nodediscover.pm @@ -353,7 +353,7 @@ sub process_request { $callback->({error=> ["The node [$node] should have a correct IP address which belongs to the management network."], errorcode=>["1"]}); return; } - if (defined ($request->{pbmc_node})) { + if (defined ($request->{pbmc_node}) and defined($request->{pbmc_node}->[0]) ) { my $pbmc_node = $request->{pbmc_node}->[0]; xCAT::Utils->cleanup_for_powerLE_hardware_discovery($node, $pbmc_node, $doreq); }