Rework plugin_comand to use XCATSITEVALS instead of polling site table for select plugins

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@11982 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
jbjohnso 2012-03-25 15:15:21 +00:00
parent 2f1b7d8fb6
commit dacd2690c4

View File

@ -1023,17 +1023,15 @@ sub plugin_command {
if ($hdlspec =~ /^site:/) { #A site entry specifies a plugin
my $sitekey = $hdlspec;
$sitekey =~ s/^site://;
$sitetab = xCAT::Table->new('site');
my $sent = $sitetab->getAttribs({key=>$sitekey},['value']);
if ($sent and $sent->{value}) { #A site style plugin specification is just like
if ($::XCATSITEVALS{$sitekey}) {#A site style plugin specification is just like
#a static global, it grabs all nodes rather than some
$useglobals = -1; #If they tried to specify anything, don't use the default global handlers at all
unless (@nodes) {
$handler_hash{$sent->{value}} = 1;
$handler_hash{$::XCATSITEVALS{$sitekey}} = 1;
$usesiteglobal = 1;
}
foreach (@nodes) { #Specified a specific plugin, not a table lookup
$handler_hash{$sent->{value}}->{$_} = 1;
$handler_hash{$::XCATSITEVALS{$sitekey}}->{$_} = 1;
}
}
} elsif ($hdlspec =~ /:/) { #Specificed a table lookup path for plugin name