From 50352afb396f75252aebe36877963e7d1892540b Mon Sep 17 00:00:00 2001 From: leiaibj Date: Wed, 24 Oct 2012 07:14:11 +0000 Subject: [PATCH] Fix one bug: after discovery stopped, we can still discover some nodes git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@14104 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/profilednodes.pm | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/profilednodes.pm b/xCAT-server/lib/xcat/plugins/profilednodes.pm index ab224529f..5b60e5b5c 100644 --- a/xCAT-server/lib/xcat/plugins/profilednodes.pm +++ b/xCAT-server/lib/xcat/plugins/profilednodes.pm @@ -741,8 +741,8 @@ sub nodediscoverstart{ } # Read DB to confirm the discover is not started yet. - my @sitevalues = xCAT::TableUtils->get_site_attribute("__PCMDiscover"); - if ($sitevalues[0]){ + my $discover_running = xCAT::ProfiledNodeUtils->is_discover_started(); + if ($discover_running){ setrsp_errormsg("Profiled nodes discovery already started."); return; } @@ -775,8 +775,8 @@ sub nodediscoverstart{ sub nodediscoverstop{ # Read DB to confirm the discover is started. xCAT::MsgUtils->message("Stopping profiled node's discover."); - my @sitevalues = xCAT::TableUtils->get_site_attribute("__PCMDiscover"); - if (! $sitevalues[0]){ + my $discover_running = xCAT::ProfiledNodeUtils->is_discover_started(); + if (! $discover_running){ setrsp_errormsg("Profiled nodes discovery not started yet."); return; } @@ -830,9 +830,8 @@ sub nodediscoverstatus{ #------------------------------------------------------- sub nodediscoverls{ # Read DB to confirm the discover is started. - my @sitevalues = (); - @sitevalues = xCAT::TableUtils->get_site_attribute("__PCMDiscover"); - if (! $sitevalues[0]){ + my $discover_running = xCAT::ProfiledNodeUtils->is_discover_started(); + if (! $discover_running){ setrsp_errormsg("Profiled nodes discovery not started yet."); return; } @@ -889,7 +888,7 @@ sub findme{ xCAT::MsgUtils->message('S', "Profield nodes discover: Start.\n"); # Read DB to confirm the discover is started. my @sitevalues = xCAT::TableUtils->get_site_attribute("__PCMDiscover"); - if (! @sitevalues){ + if (! $sitevalues[0]){ setrsp_errormsg("Profiled nodes discovery not started yet."); return; }