Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core

This commit is contained in:
Jarrod Johnson 2013-10-08 16:09:14 -04:00
commit e81fae18d1
3 changed files with 17 additions and 7 deletions

View File

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

View File

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

View File

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