enhance for finding bootnic in genesis

This commit is contained in:
mellor 2014-09-22 20:35:18 -07:00
parent 92d313bb20
commit 5576b8b1f4
2 changed files with 18 additions and 4 deletions

View File

@ -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

View File

@ -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);
}