From bf31543b8fd5adcc540317ab46fb71601a0338e1 Mon Sep 17 00:00:00 2001 From: zhaoertao Date: Fri, 9 Nov 2012 03:32:39 +0000 Subject: [PATCH] add attribute 'dfmdispatch' for site table to enable or disable the DFM hdwr_ctrl dispatch git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@14284 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/Schema.pm | 2 ++ xCAT-server/lib/perl/xCAT/PPC.pm | 15 +++++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/perl-xCAT/xCAT/Schema.pm b/perl-xCAT/xCAT/Schema.pm index 4c9bc8ebf..5f4211aa0 100644 --- a/perl-xCAT/xCAT/Schema.pm +++ b/perl-xCAT/xCAT/Schema.pm @@ -887,6 +887,8 @@ site => { " match the path in the installdir attribute.\n\n". " ipmidispatch: Whether or not to send ipmi hw control operations to the service\n". " node of the target compute nodes. Default is 'y'.\n\n". + " dfmdispatch: Whether or not to send ipmi hw control operations to the service\n". + " node of the target compute nodes. Default is 'y'.\n\n". " ipmimaxp: The max # of processes for ipmi hw ctrl. The default is 64. Currently,\n". " this is only used for HP hw control.\n\n". " ipmiretries: The # of retries to use when communicating with BMCs. Default is 3.\n\n". diff --git a/xCAT-server/lib/perl/xCAT/PPC.pm b/xCAT-server/lib/perl/xCAT/PPC.pm index 665499ece..391dbbb00 100644 --- a/xCAT-server/lib/perl/xCAT/PPC.pm +++ b/xCAT-server/lib/perl/xCAT/PPC.pm @@ -1980,8 +1980,19 @@ sub preprocess_request { # build an individual request for each service node my $service = "xcat"; my @hcps=keys(%hcp_hash); - my $sn = xCAT::ServiceNodeUtils->get_ServiceNode(\@hcps, $service, "MN"); - + my $sn; + my @dfmdispatch = xCAT::TableUtils->get_site_attribute("dfmdispatch"); + if (defined($dfmdispatch[0]) and ($dfmdispatch[0] =~ /0|n/i)) { + if ($masters[0]) { + push @{$sn->{$masters[0]}}, @hcps; + } else { + $callback->({data=>["The value of the attribute master in the site table is NOT set"]}); + $req = {}; + return; + } + } else { + $sn = xCAT::ServiceNodeUtils->get_ServiceNode(\@hcps, $service, "MN"); + } # build each request for each service node foreach my $snkey (keys %$sn) {