fix bug 3556007: modifications related to Utils.pm

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@13574 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
zhaoertao 2012-08-22 07:36:09 +00:00
parent 0864a72444
commit 78dd04ac4a
10 changed files with 30 additions and 15 deletions

View File

@ -12,6 +12,7 @@ use strict;
use lib "$::XCATROOT/lib/perl";
use xCAT::Utils;
use xCAT::TableUtils;
use POSIX qw(:signal_h :errno_h :sys_wait_h);
use IO::Socket::SSL;
use XML::Simple;
@ -133,7 +134,7 @@ foreach my $interf (@interfaces) {
sub fping_pping {
my $nodes = shift;
my $master = xCAT::Utils->get_site_Master();
my $master = xCAT::TableUtils->get_site_Master();
my $masterip = xCAT::NetworkUtils->getipaddr($master);
if ($masterip =~ /:/) #IPv6, needs fping6 support
{

View File

@ -18,6 +18,7 @@ use Getopt::Long;
require xCAT::MsgUtils;
require xCAT::DSHCLI;
use xCAT::Utils;
use xCAT::TableUtils;
use xCAT::RemoteShellExp;
require xCAT::Client;
my $bname = basename($0);
@ -270,7 +271,7 @@ sub parse_args_xdsh
# get the directories on the servicenode to put the files in
my $defaultsyndir = "/var/xcat/syncfiles";
my @syndir = xCAT::Utils->get_site_attribute("SNsyncfiledir");
my @syndir = xCAT::TableUtils->get_site_attribute("SNsyncfiledir");
my $synfiledir;
if ($syndir[0])
{
@ -282,7 +283,7 @@ sub parse_args_xdsh
}
# for append function
my $defaultnodesyndir = "/var/xcat/node/syncfiles";
my @syndir2 = xCAT::Utils->get_site_attribute("nodesyncfiledir");
my @syndir2 = xCAT::TableUtils->get_site_attribute("nodesyncfiledir");
my $synfiledir2;
if ($syndir2[0])
{

View File

@ -13,6 +13,7 @@ use strict;
use Getopt::Std;
use POSIX qw(strftime);
use xCAT::Utils;
use xCAT::TableUtils;
use xCAT::MsgUtils;
use IO::File;
use TEAL::Semaphore;
@ -100,7 +101,7 @@ if (!$batch) { #handle single event
}
}
my ($rc, $msg)=xCAT::Utils->logEventsToTealDatabase(\@a);
my ($rc, $msg)=xCAT::TableUtils->logEventsToTealDatabase(\@a);
if ($rc) {
xCAT::MsgUtils->message('S', "logeventtoteal:$msg. The condition is $condname. The response is $respname.\n");
} else {

View File

@ -9,6 +9,9 @@ use lib "$::XCATROOT/lib/perl";
use strict;
use xCAT::Table;
use xCAT::Utils;
use xCAT::TableUtils;
use xCAT::NetworkUtils;
use xCAT::MsgUtils;
use Getopt::Long;
@ -69,7 +72,7 @@ if ($hmtab) {
my $file = "/var/log/consoles/$node";
#if has conserver, goto conserver the execute replaycons command
my @hostinfo=xCAT::Utils->determinehostname();
my @hostinfo=xCAT::NetworkUtils->determinehostname();
my %iphash=();
foreach(@hostinfo) {$iphash{$_}=1;}
if (($conserver) && ($iphash{$conserver} != 1)) {

View File

@ -18,6 +18,8 @@ use xCAT::SPD qw/decode_spd/;
use POSIX qw(ceil floor);
use Storable qw(store_fd retrieve_fd thaw freeze);
use xCAT::Utils;
use xCAT::TableUtils;
use xCAT::ServiceNodeUtils;
use xCAT::SvrUtils;
use xCAT::Usage;
use Thread qw(yield);
@ -6050,7 +6052,7 @@ sub preprocess_request {
# find service nodes for requested nodes
# build an individual request for each service node
my $service = "xcat";
my $sn = xCAT::Utils->get_ServiceNode($noderange, $service, "MN");
my $sn = xCAT::ServiceNodeUtils->get_ServiceNode($noderange, $service, "MN");
# build each request for each service node

View File

@ -49,6 +49,9 @@ use HTTP::Request;
use XML::LibXML;
use xCAT::Table;
use xCAT::Utils;
use xCAT::TableUtils;
use xCAT::ServiceNodeUtils;
use xCAT::MsgUtils;
sub handled_commands{
@ -225,7 +228,7 @@ sub preprocess_request {
# The dispatch depends on the rhevm. Since the operation is in serial, so no need to use the service node.
my @requests;
my @rhevms=keys(%rhevm_hash);
my $sn = xCAT::Utils->get_ServiceNode(\@rhevms, 'xcat', "MN");
my $sn = xCAT::ServiceNodeUtils->get_ServiceNode(\@rhevms, 'xcat', "MN");
foreach my $snkey (keys %$sn){
my $reqcopy = {%$request};
$reqcopy->{'_xcatdest'} = $snkey;
@ -401,7 +404,7 @@ sub copycd {
}
my $installroot = "/install";
my @entries = xCAT::Utils->get_site_attribute("installdir");
my @entries = xCAT::TableUtils->get_site_attribute("installdir");
my $t_entry = $entries[0];
if ( defined($t_entry) ) {
$installroot = $t_entry;
@ -485,7 +488,7 @@ sub mkinstall {
my %doneimgs;
my $installdir = "/install";
my @ents = xCAT::Utils->get_site_attribute("installdir");
my @ents = xCAT::TableUtils->get_site_attribute("installdir");
my $site_ent = $ents[0];
if( defined($site_ent) )
{
@ -493,7 +496,7 @@ sub mkinstall {
}
my $tftpdir = "/tftpboot";
@ents = xCAT::Utils->get_site_attribute("tftpdir");
@ents = xCAT::TableUtils->get_site_attribute("tftpdir");
$site_ent = $ents[0];
if( defined($site_ent) )
{
@ -732,7 +735,7 @@ sub addhost {
my $callback = shift;
my $rhevm_hash = shift;
my @domain = xCAT::Utils->get_site_attribute("domain");
my @domain = xCAT::TableUtils->get_site_attribute("domain");
if (!$domain[0]) {
my $rsp;
push @{$rsp->{data}}, "The site.domain must be set to enable the rhev support.";

View File

@ -12,6 +12,7 @@ use File::Find;
use Getopt::Long;
use Cwd qw(realpath);
use xCAT::Utils;
use xCAT::TableUtils;
use File::Temp qw/mkdtemp/;
use FindBin;
@ -402,7 +403,7 @@ unless ($onlyinitrd) {
# ignore any return code
# Add the local repo from MN
my $master = xCAT::Utils->get_site_Master();
my $master = xCAT::TableUtils->get_site_Master();
open($aptconfig,">","$rootimg_dir/etc/apt/sources.list");
print $aptconfig "deb http://$master$installroot/$osver/$arch/ $dist main\n";
close($aptconfig);

View File

@ -12,6 +12,7 @@ use File::Find;
use Getopt::Long;
use Cwd qw(realpath);
use xCAT::Utils;
use xCAT::TableUtils;
#use strict;
Getopt::Long::Configure("bundling");
Getopt::Long::Configure("pass_through");
@ -324,7 +325,7 @@ unless ($onlyinitrd) {
# ignore any return code
# Add the local repo from MN
my $master = xCAT::Utils->get_site_Master();
my $master = xCAT::TableUtils->get_site_Master();
open($aptconfig,">","$rootimg_dir/etc/apt/sources.list");
print $aptconfig "deb http://$master$installroot/$osver/$arch/ $dist main\n";
close($aptconfig);

View File

@ -14,6 +14,7 @@ BEGIN
use lib "$::XCATROOT/lib/perl";
use xCAT::Utils;
use xCAT::TableUtils;
use strict;
use Socket; # for name resolution
@ -21,7 +22,7 @@ my $ip='';
my $mm='';
my $slot='';
my $log = "/var/log/xcatsnmp";
my $tftpdir = xCAT::Utils->getTftpDir();
my $tftpdir = xCAT::TableUtils->getTftpDir();
open(FILE,">>$log") or die "Can't open log!!!";

View File

@ -11,6 +11,7 @@ BEGIN
use lib "$::XCATROOT/lib/perl";
use xCAT::Utils;
use xCAT::TableUtils;
use strict;
use Socket;
@ -20,7 +21,7 @@ if(! $blades) {
exit;
}
my $tftpdir = xCAT::Utils->getTftpDir();
my $tftpdir = xCAT::TableUtils->getTftpDir();
foreach my $blade (`/opt/xcat/bin/nodels $blades`){
chomp($blade);