From c8264f231a02e088fac4fa668a7c4d3667b84550 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Mon, 30 Mar 2009 14:19:17 +0000 Subject: [PATCH] -Have Client library use a more reliable method than environment to get home directory -Change conserver backends to not bother with setting HOME variable at all git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@3045 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/Client.pm | 7 ++++--- xCAT-server/share/xcat/cons/blade | 5 ----- xCAT-server/share/xcat/cons/ipmi | 1 - xCAT-server/share/xcat/cons/kvm | 1 - xCAT-server/share/xcat/cons/xen | 1 - 5 files changed, 4 insertions(+), 11 deletions(-) diff --git a/perl-xCAT/xCAT/Client.pm b/perl-xCAT/xCAT/Client.pm index 3d96ac0d2..0b7f62bc3 100644 --- a/perl-xCAT/xCAT/Client.pm +++ b/perl-xCAT/xCAT/Client.pm @@ -73,9 +73,10 @@ sub submit_request { my $keyfile = shift; my $certfile = shift; my $cafile = shift; - unless ($keyfile) { $keyfile = $ENV{HOME}."/.xcat/client-cred.pem"; } - unless ($certfile) { $certfile = $ENV{HOME}."/.xcat/client-cred.pem"; } - unless ($cafile) { $cafile = $ENV{HOME}."/.xcat/ca.pem"; } + require xCAT::Utils; + unless ($keyfile) { $keyfile = xCAT::Utils->getHomeDir()."/.xcat/client-cred.pem"; } + unless ($certfile) { $certfile = xCAT::Utils->getHomeDir()."/.xcat/client-cred.pem"; } + unless ($cafile) { $cafile = xCAT::Utils->getHomeDir()."/.xcat/ca.pem"; } $xCAT::Client::EXITCODE = 0; # clear out exit code before invoking the plugin diff --git a/xCAT-server/share/xcat/cons/blade b/xCAT-server/share/xcat/cons/blade index e0dc77167..65b91a993 100755 --- a/xCAT-server/share/xcat/cons/blade +++ b/xCAT-server/share/xcat/cons/blade @@ -37,11 +37,6 @@ BEGIN } my $sleepint=int(rand(10)); #Stagger start to avoid overwhelming conserver/xCATd use lib "$::XCATROOT/lib/perl"; -if ($^O =~ /^linux/i){ - $ENV{HOME}='/root/'; -} else { - $ENV{HOME}='/'; -} require xCAT::Client; #require xCAT::Table; diff --git a/xCAT-server/share/xcat/cons/ipmi b/xCAT-server/share/xcat/cons/ipmi index 861486c4d..5e61c37da 100755 --- a/xCAT-server/share/xcat/cons/ipmi +++ b/xCAT-server/share/xcat/cons/ipmi @@ -37,7 +37,6 @@ BEGIN my $sleepint=int(rand(10)); #Stagger start to avoid overwhelming conserver/xCATd $::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : '/opt/xcat'; use lib "$::XCATROOT/lib/perl"; -$ENV{HOME}='/root/'; require xCAT::Client; my $username = 'USERID'; my $password = 'PASSW0RD'; diff --git a/xCAT-server/share/xcat/cons/kvm b/xCAT-server/share/xcat/cons/kvm index 2f99c8a7d..ef4689861 100755 --- a/xCAT-server/share/xcat/cons/kvm +++ b/xCAT-server/share/xcat/cons/kvm @@ -44,7 +44,6 @@ BEGIN #} my $sleepint; use lib "$::XCATROOT/lib/perl"; -$ENV{HOME}='/root/'; require xCAT::Client; require File::Basename; diff --git a/xCAT-server/share/xcat/cons/xen b/xCAT-server/share/xcat/cons/xen index b75675b5d..6813c35d7 100755 --- a/xCAT-server/share/xcat/cons/xen +++ b/xCAT-server/share/xcat/cons/xen @@ -44,7 +44,6 @@ BEGIN #} my $sleepint; use lib "$::XCATROOT/lib/perl"; -$ENV{HOME}='/root/'; require xCAT::Client; require File::Basename;