From 54982068cfa96580d1366ec9233bae9da26de1da Mon Sep 17 00:00:00 2001 From: ligc Date: Fri, 21 Feb 2014 12:39:57 -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 | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/hosts.pm b/xCAT-server/lib/xcat/plugins/hosts.pm index 77217fd52..abd762dc8 100755 --- a/xCAT-server/lib/xcat/plugins/hosts.pm +++ b/xCAT-server/lib/xcat/plugins/hosts.pm @@ -288,9 +288,16 @@ sub add_hosts_content { } else { - my $rsp; - push @{$rsp->{data}}, "Invalid IP Addr \'$ref->{ip}\' for node \'$ref->{node}\'."; - xCAT::MsgUtils->message("E", $rsp, $callback); + 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}))