bug 3243565: fix for <xcatmaster> support for networks.gateway

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@9180 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
ligc 2011-03-30 06:06:38 +00:00
parent 0b68e93d5f
commit 8f32293390
2 changed files with 23 additions and 0 deletions

View File

@ -1949,6 +1949,22 @@ sub getNetwkInfo
$nethash{$node}{'gateway'} = '';
}
$nethash{$node}{'myselfgw'} = 1;
# For hwctrl commands, it is possible that this subroutine is called
# on MN instead of SN, if the hcp SN is not set
if (xCAT::Utils->isMN() && !$nethash{$node}{'gateway'})
{
# does not have ip address in this subnet,
# use the node attribute 'xcatmaster'
my $noderestab = xCAT::Table->new('noderes');
my $et = $noderestab->getNodeAttribs($node, ['xcatmaster']);
if ($et and defined($et->{'xcatmaster'}))
{
my $value = $et->{'xcatmaster'};
$nethash{$node}{'gateway'} = xCAT::NetworkUtils->getipaddr($value);
}
$noderestab->close();
}
}
next;
}

View File

@ -482,6 +482,13 @@ sub donets
$gw = $netgw{'0.0.0.0'}{'0.0.0.0'}; #default gatetway
}
}
# set gateway to keyword <xcatmaster>,
# to indicate to use the cluster-facing ip address
# on this management node or service node
if (!$gw)
{
$gw = "<xcatmaster>";
}
# use convention for netname attr
my $netn;