From 171c5a189f875f883821729487078988ab9001d2 Mon Sep 17 00:00:00 2001 From: daniceexi Date: Mon, 1 Jul 2013 09:11:24 +0000 Subject: [PATCH] defect 3660: display the correct message when run nodediscoverdef command defines a request a node which has not correct IP. git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@16855 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/nodediscover.pm | 6 ++++++ xCAT-server/lib/xcat/plugins/seqdiscovery.pm | 8 ++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) 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;