2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-08-26 21:20:29 +00:00

Set xcatmaster to facing IP in priority when the node is managed by service node. (#3696)

* Fix #3428, set xcatmaster to facing IP in priority when the node is mananged by service node.

* Always using my facing IP first than site.master

* remove non-used variable sitemaster
This commit is contained in:
Bin Xu
2017-08-22 10:21:00 +08:00
committed by yangsong
parent 39b3836709
commit a263773b15

View File

@@ -82,9 +82,9 @@ sub subvars {
close($inh);
#the logic to determine the $ENV{XCATMASTER} confirm to the following priority(from high to low):
#the "xcatmaster" attribute of the node
#the site.master
#the ip address of the mn facing the compute node
## 1, the "xcatmaster" attribute of the node
## 2, the ip address of the mn/sn facing the compute node
## 3, the site.master
my $master;
#the "xcatmaster" attribute of the node
@@ -94,16 +94,6 @@ sub subvars {
$master = $et->{'xcatmaster'};
}
unless ($master) {
#the site.master
my @masters = xCAT::TableUtils->get_site_attribute("master");
my $tmp = $masters[0];
if (defined($tmp)) {
$master = $tmp;
}
}
unless ($master) {
#the ip address of the mn facing the compute node
@@ -115,14 +105,23 @@ sub subvars {
}
}
unless ($master) {
#the site.master
my @masters = xCAT::TableUtils->get_site_attribute("master");
my $tmp = $masters[0];
if (defined($tmp)) {
$master = $tmp;
}
}
unless ($master) {
$tmplerr = "Unable to identify master for $node";
return;
}
$ENV{XCATMASTER} = $master;
my ($host, $ipaddr) = xCAT::NetworkUtils->gethostnameandip($master);
my $ipaddr = xCAT::NetworkUtils->getipaddr($master);
if ($ipaddr) {
$ENV{MASTER_IP} = "$ipaddr";
}