Change the code to generate MACADDRESS var in mypostscript. var MACMAC will show the mac.mac. var MACADDRESS will show the installnic which calculated from mac.mac

This commit is contained in:
daniceexi 2015-03-06 05:22:40 -05:00
parent 6227d2f2b6
commit 19853bf2d2
2 changed files with 13 additions and 2 deletions

View File

@ -518,6 +518,13 @@ sub makescript {
## kit and kitcomponent parameter.
my $kitcomp_deployparams = getKitcompDeployParams($osimgname,\%image_hash);
# get mac address for the node
my $macaddress;
if( defined( $::GLOBAL_TAB_HASH{mac}) && defined( $::GLOBAL_TAB_HASH{mac}{$node}) ) {
my $macmac = $::GLOBAL_TAB_HASH{mac}{$node}{mac};
$macaddress = xCAT::Utils->parseMacTabEntry($macmac, $node);
}
#ok, now do everything else..
#$inc =~ s/#XCATVAR:([^#]+)#/envvar($1)/eg;
#$inc =~ s/#ENV:([^#]+)#/envvar($1)/eg;
@ -545,6 +552,8 @@ sub makescript {
#$inc =~ s/#COMMAND:([^#]+)#/command($1)/eg;
$inc =~ s/\$NTYPE/$nodetype/eg;
$inc =~ s/\$MACADDRESS/$macaddress/eg;
# This line only is used to compatible with the old code
$inc =~ s/#Subroutine:([^:]+)::([^:]+)::([^:]+):([^#]+)#/runsubroutine($1,$2,$3,$4)/eg;

View File

@ -77,9 +77,11 @@ export UPDATENODE
NTYPE=$NTYPE
export NTYPE
MACADDRESS=#TABLE:mac:$NODE:mac#
export MACADDRESS
MACMAC=#TABLE:mac:$NODE:mac#
export MACMAC
MACADDRESS=$MACADDRESS
export MACADDRESS
## vlan related items. vlan may not be configured.
#VLAN_VARS_EXPORT#