2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-05-29 09:13:08 +00:00

enhance xcatmn for issue 4606

This commit is contained in:
huweihua 2018-10-11 04:48:54 -04:00
parent 300cc96b6a
commit 7d0caba274

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;
}
}