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;