From 9613d2f9c02b5d92d83a8204b83dbadf733a61ba Mon Sep 17 00:00:00 2001 From: bp-sawyers Date: Mon, 7 Apr 2008 20:13:11 +0000 Subject: [PATCH] Conditionally doing requires for xCAT pm's git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@995 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT-2.0/xCAT/Client.pm | 11 +++++++---- xCAT-client-2.0/bin/xdsh | 3 ++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/perl-xCAT-2.0/xCAT/Client.pm b/perl-xCAT-2.0/xCAT/Client.pm index 7d768e267..4aa3b8dfe 100644 --- a/perl-xCAT-2.0/xCAT/Client.pm +++ b/perl-xCAT-2.0/xCAT/Client.pm @@ -4,11 +4,14 @@ package xCAT::Client; BEGIN { $::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : -d '/opt/xcat' ? '/opt/xcat' : '/usr'; + require lib; + lib->import("$::XCATROOT/lib/perl"); + if ($ENV{XCATBYPASS}) { + require xCAT::NodeRange; + require xCAT::Utils; + require xCAT::Table; + } } -use lib "$::XCATROOT/lib/perl"; -require xCAT::NodeRange; -require xCAT::Utils; -require xCAT::Table; my $inet6support; use IO::Socket::SSL; diff --git a/xCAT-client-2.0/bin/xdsh b/xCAT-client-2.0/bin/xdsh index 22f497bbc..5fbe4cd7a 100644 --- a/xCAT-client-2.0/bin/xdsh +++ b/xCAT-client-2.0/bin/xdsh @@ -10,7 +10,7 @@ use File::Basename; use Getopt::Long; require xCAT::MsgUtils; require xCAT::DSHCLI; -require xCAT::Client; +#require xCAT::Client; # delay the require of this until we know if -K was specified, because of XCATBYPASS mode my $bname = basename($0); #----------------------------------------------------------------------------- @@ -119,6 +119,7 @@ if (!($::CONTEXT_SET)) } } +require xCAT::Client; xCAT::Client::submit_request($cmdref,\&xCAT::Client::handle_response); exit $xCAT::Client::EXITCODE;