Use XCATSITEVALS instead of slower table lookup

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@9897 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
jbjohnso 2011-06-22 17:29:43 +00:00
parent 8a04a0ce40
commit 6856e705db
3 changed files with 9 additions and 23 deletions

View File

@ -3509,6 +3509,9 @@ sub create_postscripts_tar
sub get_site_Master
{
if ($::XCATSITEVALS{$master}) {
return $::XCATSITEVALS{$master};
}
require xCAT::Table;
my $Master;
my $sitetab = xCAT::Table->new('site');

View File

@ -10,8 +10,8 @@ sub grab_table_data{ #grab table data relevent to VM guest nodes
my $vpdtab = xCAT::Table->new("vpd");
my $hmtab = xCAT::Table->new("nodehm");
my $nttab = xCAT::Table->new("nodetype");
my $sitetab = xCAT::Table->new("site");
$cfghash->{site}->{genmacprefix} = xCAT::Utils->get_site_attribute('genmacprefix');
#my $sitetab = xCAT::Table->new("site");
$cfghash->{site}->{genmacprefix} = $::XCATSITEVALS{genmacprefix}; #xCAT::Utils->get_site_attribute('genmacprefix');
if ($hmtab) {
$cfghash->{nodehm} = $hmtab->getNodesAttribs($noderange,['serialspeed']);
}

View File

@ -2465,13 +2465,7 @@ sub process_request {
$command = 'rmigrate';
}
my $sitetab = xCAT::Table->new('site');
if ($sitetab) {
my $xhent = $sitetab->getAttribs({key=>'usexhrm'},['value']);
if ($xhent and $xhent->{value} and $xhent->{value} !~ /no/i and $xhent->{value} !~ /disable/i) {
$use_xhrm=1;
}
}
if ($::XCATSITEVALS{usexhrm}) { $use_xhrm=1; }
$vmtab = xCAT::Table->new("vm");
$confdata={};
xCAT::VMCommon::grab_table_data($noderange,$confdata,$callback);
@ -2497,10 +2491,7 @@ sub process_request {
$vmmaxp=1; #for now throttle concurrent migrations, requires more sophisticated heuristics to ensure sanity
} else {
my $tmp;
if ($sitetab) {
($tmp)=$sitetab->getAttribs({'key'=>'vmmaxp'},'value');
if (defined($tmp)) { $vmmaxp=$tmp->{value}; }
}
if ($::XCATSITEVALS{vmmaxp}) { $vmmaxp=$::XCATSITEVALS{vmmaxp}; }
}
my $children = 0;
@ -2570,12 +2561,7 @@ sub process_request {
my @allerrornodes=();
my $check=0;
my $global_check=1;
if ($sitetab) {
(my $ref) = $sitetab->getAttribs({key => 'nodestatus'}, 'value');
if ($ref) {
if ($ref->{value} =~ /0|n|N/) { $global_check=0; }
}
}
if ($::XCATSITEVALS{nodestatus} =~ /0|n|N/) { $global_check=0; }
if ($command eq 'rpower') {
@ -2625,10 +2611,7 @@ sub process_request {
}
}
my $sent = $sitetab->getAttribs({key=>'masterimgdir'},'value');
if ($sent) {
$xCAT_plugin::kvm::masterdir=$sent->{value};
}
if ($::XCATSITEVALS{masterimgdir}) { $xCAT_plugin::kvm::masterdir=$::XCATSITEVALS{masterimgdir} }