diff --git a/perl-xCAT/xCAT/Utils.pm b/perl-xCAT/xCAT/Utils.pm index 078d2dc1f..e0cee8e67 100644 --- a/perl-xCAT/xCAT/Utils.pm +++ b/perl-xCAT/xCAT/Utils.pm @@ -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'); diff --git a/perl-xCAT/xCAT/VMCommon.pm b/perl-xCAT/xCAT/VMCommon.pm index 205d67f8f..e146fd16b 100644 --- a/perl-xCAT/xCAT/VMCommon.pm +++ b/perl-xCAT/xCAT/VMCommon.pm @@ -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']); } diff --git a/xCAT-server/lib/xcat/plugins/kvm.pm b/xCAT-server/lib/xcat/plugins/kvm.pm index 256b31039..2f34c3d49 100644 --- a/xCAT-server/lib/xcat/plugins/kvm.pm +++ b/xCAT-server/lib/xcat/plugins/kvm.pm @@ -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} }