From 9c409845ba7647171ccbf58d05b4b1462af33e1a Mon Sep 17 00:00:00 2001 From: xq2005 Date: Mon, 7 Oct 2013 22:57:42 -0700 Subject: [PATCH 1/4] bug 3809: get the dhcp info from lease file --- xCAT/postscripts/configeth | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/xCAT/postscripts/configeth b/xCAT/postscripts/configeth index d1e1d768e..b29c8f1b5 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/;$//'` From 80291f4473259db206911e3f54023a13c90f3e93 Mon Sep 17 00:00:00 2001 From: xq2005 Date: Tue, 8 Oct 2013 01:45:23 -0700 Subject: [PATCH 2/4] bug 3808: error info when running confignics --- xCAT/postscripts/configeth | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/xCAT/postscripts/configeth b/xCAT/postscripts/configeth index b29c8f1b5..356dbb872 100755 --- a/xCAT/postscripts/configeth +++ b/xCAT/postscripts/configeth @@ -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 From eb6cc1d15ce42277e8e2eac02605994f642fb2aa Mon Sep 17 00:00:00 2001 From: jjhua Date: Tue, 8 Oct 2013 16:22:58 -0400 Subject: [PATCH 3/4] fixed bug 3796. At the end of genimage, remove the repositories of zypper. --- xCAT-server/share/xcat/netboot/sles/genimage | 2 ++ 1 file changed, 2 insertions(+) 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 From 3598d5047d164b627f48dc701747fd754a739528 Mon Sep 17 00:00:00 2001 From: lissav Date: Tue, 8 Oct 2013 15:36:59 -0400 Subject: [PATCH 4/4] defect 3816 --- xCAT-server/lib/perl/xCAT/Template.pm | 4 ++++ 1 file changed, 4 insertions(+) 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 {