2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-06-18 20:30:56 +00:00

Merge pull request #2339 from xuweibj/I2336

fix issue 2336, get correct mac address
This commit is contained in:
Weihua Hu
2016-12-22 16:24:18 +08:00
committed by GitHub

View File

@ -293,6 +293,17 @@ sub check_noderange {
$mac =~ s/\!\*NOIP\*//g;
$macmap{$mac}{"ip"} = "NOIP";
$macmap{$mac}{"node"} = $node;
} elsif ($mac =~ /(\w{2}:\w{2}:\w{2}:\w{2}:\w{2}:\w{2})\!(.+)/) {
$mac = $1;
my $tmp_node = $2;
$macmap{$mac}{"node"} = $node;
my $tmp_ip = xCAT::NetworkUtils->getipaddr($tmp_node);
if ($tmp_ip) {
$macmap{$mac}{"ip"} = $tmp_ip;
$ipnodemap{ $nodecheckrst{$node}{"ip"} } = $node;
} else {
$macmap{$mac}{"ip"} = "NOIP";
}
} else {
$macmap{$mac}{"node"} = $node;
$macmap{$mac}{"ip"} = $nodecheckrst{$node}{"ip"};