2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-07-27 23:01:12 +00:00

fix for bug 2825 and 4628: print warning with makedhcp when the node ip address could not resolved, or the ip overlaps with dynamic range

This commit is contained in:
ligc
2015-05-18 04:23:02 -04:00
parent bd49b87057
commit ae636e0afa

View File

@@ -593,6 +593,18 @@ sub addnode
} elsif ($guess_next_server) {
$nxtsrv='${next-server}'; #if floating IP support, cause gPXE command-line expansion patch to drive inheritence from network
}
# The hostname could not be resolved, print a warning message
if (!$ip)
{
$callback->(
{
warning => [
"The hostname $hname of node $node could not be resolved."
]
}
);
}
my $doiscsi=0;
if ($ient and $ient->{server} and $ient->{target}) {
$doiscsi=1;
@@ -715,6 +727,18 @@ sub addnode
{
if ($ip and not ipIsDynamic($ip)) {
print $omshell "set ip-address = $ip\n";
} else {
# only if when ip is not blank, blank ip warning already done earlier in the code
if ($ip)
{
$callback->(
{
warning => [
"The ip address $ip of node $node overlaps with the DHCP dynamic range specified in networks table, will not add this ip address into dhcpd.leases file."
]
}
);
}
}
if ($lstatements)
{