diff --git a/xCAT-server/lib/perl/xCAT/Template.pm b/xCAT-server/lib/perl/xCAT/Template.pm index ea41e6065..5ecf866ad 100644 --- a/xCAT-server/lib/perl/xCAT/Template.pm +++ b/xCAT-server/lib/perl/xCAT/Template.pm @@ -894,7 +894,11 @@ sub tabdb } } #$tmplerr="Unable to find requested $field from $table, with $key"; + my $savekey=$key; + $key = '$NODE'; # make sure we use getNodeAttribs when get_replacement + # calls this routine (tabdb) my $rep=get_replacement($table,$key,$field); + $key=$savekey; # restore just in case we rely on the node=$node setting if ($rep) { return tabdb($rep->[0], $rep->[1], $rep->[2]); } else { diff --git a/xCAT-server/share/xcat/netboot/sles/genimage b/xCAT-server/share/xcat/netboot/sles/genimage index 35af5ee8d..d22bf48eb 100755 --- a/xCAT-server/share/xcat/netboot/sles/genimage +++ b/xCAT-server/share/xcat/netboot/sles/genimage @@ -674,6 +674,8 @@ EOS_UNAME } +system("rm -rf $rootimg_dir/etc/zypp/repos.d/*"); + # output the changed the attributes so that it can be save into db by the caller. # all the information has been gathered # now, update the linuximage and osimage tables diff --git a/xCAT/postscripts/configeth b/xCAT/postscripts/configeth index d1e1d768e..356dbb872 100755 --- a/xCAT/postscripts/configeth +++ b/xCAT/postscripts/configeth @@ -388,21 +388,21 @@ elif [ "$1" = "-s" ];then exit 0 elif [ -f "/etc/debian_version" ];then str_lease_file="/var/lib/dhcp/dhclient."$str_inst_nic".leases" - if [ -e $str_lease_file ];then + if [ -e "$str_lease_file" ];then str_inst_ip=`grep fixed-address $str_lease_file | tail -n 1 | awk '{print $2}' | sed 's/;$//'` str_inst_mask=`grep subnet-mask $str_lease_file | tail -n 1 | awk '{print $3}' | sed 's/;$//'` str_inst_gateway=`grep routers $str_lease_file | tail -n 1 | awk '{print $3}' | sed 's/;$//'` fi elif [ -f "/etc/SuSE-release" ];then str_lease_file="/var/lib/dhcpcd/dhcpcd-"$str_inst_nic".info" - if [ -e $str_lease_file ];then + if [ -e "$str_lease_file" ];then str_inst_ip=`grep IPADDR $str_lease_file | tail -n 1 | awk -F'=' '{print $2}' | sed "s/'//g"` str_inst_mask=`grep NETMASK $str_lease_file | tail -n 1 | awk -F'=' '{print $2}' | sed "s/'//g"` str_inst_gateway=`grep GATEWAYS $str_lease_file | tail -n 1 | awk -F'=' '{print $2}' | sed "s/'//g"` fi else - str_lease_file=`ls /var/lib/dhclient/*$str_inst_nic*` - if [ -e $str_lease_file ];then + str_lease_file=`ls /var/lib/dhclient/*$str_inst_nic* | grep leases` + if [ -e "$str_lease_file" ];then str_inst_ip=`grep fixed-address $str_lease_file | tail -n 1 | awk '{print $2}' | sed 's/;$//'` str_inst_mask=`grep subnet-mask $str_lease_file | tail -n 1 | awk '{print $3}' | sed 's/;$//'` str_inst_gateway=`grep routers $str_lease_file | tail -n 1 | awk '{print $3}' | sed 's/;$//'` @@ -784,9 +784,13 @@ else num_ipv4_index=0 num_ipv6_index=0 num_index=0 - cat $str_his_file | grep $str_nic_name - if [ $? -ne 0 ];then - echo "${str_nic_name}" >> $str_his_file + if [ -e "$str_his_file" ];then + grep $str_nic_name $str_his_file + if [ $? -ne 0 ];then + echo "${str_nic_name}" >> $str_his_file + fi + else + echo "${str_nic_name}" > $str_his_file fi #delete the old alias configuration files on redhat if [ "$str_os_type" = "redhat" ];then