diff --git a/xCAT/postscripts/confignetwork b/xCAT/postscripts/confignetwork index 01c60e8c0..ab4a9b4ba 100755 --- a/xCAT/postscripts/confignetwork +++ b/xCAT/postscripts/confignetwork @@ -81,6 +81,7 @@ function get_nic_cfg_file_content { boot_install_nic=0 str_ib_nics='' num_iba_ports= +ignore_nicips=0 for arg in "$@" do if [ "$arg" = "-s" ];then @@ -88,6 +89,10 @@ do elif [ "${arg:0:10}" = "--ibaports" ];then num_iba_ports=${arg#--ibaports=} fi + # --allownoip means ignore if nicips are not configured or not + if [ "$arg" = "--allownoip" ]; then + ignore_nicips=1 + fi done if [ "$SETINSTALLNIC" = "1" ] || [ "$SETINSTALLNIC" = "yes" ]; then bool_install_nic=1 @@ -336,8 +341,12 @@ function sort_nics_device_order { echo $alonenic fi else - errorcode=1 - echo "Error: nicips,nictypes and nicnetworks should be configured in nics table for $alonenic." + if [ $ignore_nicips -eq 1 ] && [ -z "$alonenicips" ]; then + echo "nic $alonenic found, but incomplete configuration in node definition." + else + errorcode=1 + echo "Error: nicips,nictypes and nicnetworks should be configured in nics table for $alonenic." + fi ((num1+=1)) continue fi @@ -635,6 +644,9 @@ parser_nic_attribute "$NICTYPES" "nictypes" #make hash for nicips parser_nic_attribute "$NICIPS" "nicips" +#make hash for nicnetworks +parser_nic_attribute "$NICNETWORKS" "nicnetworks" + #make hash for niccustomscripts parser_nic_attribute "$NICCUSTOMSCRIPTS" "niccustomscripts" @@ -659,8 +671,14 @@ if [ $? -eq 0 ]; then errorcode=1 fi +#when --allownoip is used, print incomplete nics +nonicips_list=`echo "$sorted_nicdevice_list" | grep "incomplete"` +if [ $? -eq 0 ]; then + echo "$nonicips_list"| log_lines info +fi + #delete invalid nics device pair based on Error -valid_sorted_nicdevice_list=`echo "$sorted_nicdevice_list" | sed '/Error/d'` +valid_sorted_nicdevice_list=`echo "$sorted_nicdevice_list" | sed '/Error/d' | sed '/incomplete configuration/d'` if [ -n "$valid_sorted_nicdevice_list" ]; then log_info "All valid nics and device list:" echo "$valid_sorted_nicdevice_list" |log_lines info