2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-06-24 15:05:36 +00:00

Merge pull request #5693 from hu-weihua/probe

enhance xcatmn for issue  4606
This commit is contained in:
xuweibj
2018-10-12 09:37:43 +08:00
committed by GitHub

View File

@ -388,10 +388,17 @@ sub check_site_table {
$rst = 1;
}
} else {
if (($attr eq "master") and (!probe_utils->is_ip_addr("$value"))) {
push @$error_ref, "The value of 'master' in 'site' table isn't an IP addres";
$rst = 1;
if (($attr eq "master") and (!xCAT::NetworkUtils->isIpaddr("$value"))) {
my $masterip = xCAT::NetworkUtils->getipaddr("$value");
if (! defined $masterip){
push @$error_ref, "The value of 'master' in 'site' table isn't an IP addres and can not be resolved to a IP addres";
$rst = 1;
}else{
probe_utils->send_msg("$output", "i", "The value of 'master' in 'site' table is $value, can be resolve to $masterip") if($verbose);
$value = $masterip;
}
}
$sitetable_ref->{$attr} = $value;
}
}