From db8efd37b9cf5c64b7fcdf68fe4ff8acf7b3da28 Mon Sep 17 00:00:00 2001 From: ligc Date: Fri, 21 Feb 2014 12:41:37 -0600 Subject: [PATCH] fix for bug 3991: if the node can not be resolved or ip address is not valid, print warning message and ignore the node --- xCAT-server/lib/xcat/plugins/hosts.pm | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/hosts.pm b/xCAT-server/lib/xcat/plugins/hosts.pm index 72767738a..963f9c868 100755 --- a/xCAT-server/lib/xcat/plugins/hosts.pm +++ b/xCAT-server/lib/xcat/plugins/hosts.pm @@ -288,13 +288,20 @@ sub add_hosts_content { { addnode $callback, $nodename, $ip, $ref->{hostnames}, $domain; } - else - { - my $rsp; - push @{$rsp->{data}}, "Invalid IP Addr \'$ref->{ip}\' for node \'$ref->{node}\'."; - xCAT::MsgUtils->message("E", $rsp, $callback); - } - + else + { + my $rsp; + if (!$ip) + { + push @{$rsp->{data}}, "Ignoring node \'$nodename\', it can not be resolved."; + } + else + { + push @{$rsp->{data}}, "Ignoring node \'$nodename\', its ip address \'$ip\' is not valid."; + } + xCAT::MsgUtils->message("W", $rsp, $callback); + } + if (defined($ref->{otherinterfaces})) { addotherinterfaces $callback, $nodename, $ref->{otherinterfaces}, $domain;