From d707d7f12d5c787420e8e7e836eae150e4a6928a Mon Sep 17 00:00:00 2001 From: Casandra Qiu Date: Tue, 16 Jun 2015 10:32:50 -0400 Subject: [PATCH] Bug #4693 switchdiscover -w return wrong info if no switch discovered --- xCAT-server/lib/xcat/plugins/switchdiscover.pm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/switchdiscover.pm b/xCAT-server/lib/xcat/plugins/switchdiscover.pm index ce330189b..3d168724a 100644 --- a/xCAT-server/lib/xcat/plugins/switchdiscover.pm +++ b/xCAT-server/lib/xcat/plugins/switchdiscover.pm @@ -390,6 +390,12 @@ sub process_request { } } } + + if (!($result)) { + send_msg( \%request, 0, " No switch found "); + return; + } + my $display_done = 0; if (exists($globalopt{r})) { @@ -609,7 +615,7 @@ sub nmap_scan { my $ccmd; - send_msg($request, 0, "Discovering switches using nmap. It may take long time..."); + send_msg($request, 0, "Discovering switches using nmap for @$ranges. It may take long time..."); ################################################# # If --range options, take iprange, if noderange is defined # us the ip addresses of the nodes. If none is define, use the