diff --git a/xCAT-server/lib/xcat/plugins/nodediscover.pm b/xCAT-server/lib/xcat/plugins/nodediscover.pm index a6bb3b44a..bd828f8c8 100644 --- a/xCAT-server/lib/xcat/plugins/nodediscover.pm +++ b/xCAT-server/lib/xcat/plugins/nodediscover.pm @@ -324,6 +324,12 @@ sub process_request { } } } + + # make sure the node has the correct ip configured + unless ($clientip) { + $callback->({error=> ["The node [$node] should have a correct IP address which belongs to the management network."], errorcode=>["1"]}); + return; + } my $restartstring = "restart"; if (scalar @forcenics > 0) { diff --git a/xCAT-server/lib/xcat/plugins/seqdiscovery.pm b/xCAT-server/lib/xcat/plugins/seqdiscovery.pm index 7c9c652ba..ab1d6e05f 100644 --- a/xCAT-server/lib/xcat/plugins/seqdiscovery.pm +++ b/xCAT-server/lib/xcat/plugins/seqdiscovery.pm @@ -1060,8 +1060,12 @@ Usage: $request->{node} = [$node]; $request->{discoverymethod} = ['manual']; $request->{updateswitch} = ['yes']; - $subreq->($request); - xCAT::MsgUtils->message("I", {data=>["Defined [$uuid] to node $node."]}, $callback); + my $rsp = $subreq->($request); + if (defined ($rsp->{errorcode}->[0])) { + xCAT::MsgUtils->message("E", $rsp, $callback); + } else { + xCAT::MsgUtils->message("I", {data=>["Defined [$uuid] to node $node."]}, $callback); + } } else { $usage->($callback); return;