From 3ff385bd083b75bb85be55a19060fe21e2a11963 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Thu, 21 Oct 2010 14:21:10 +0000 Subject: [PATCH] -Allow passing XCAT_BLADEUSER and XCAT_BLADEPASS via env variables from client to server. Suggested usage: XCAT_BLADEUSER=$USER or user echo -n "Enter Password: " read -s XCAT_BLADEPASS etc. git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@7901 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/blade.pm | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/blade.pm b/xCAT-server/lib/xcat/plugins/blade.pm index 943838b24..5c9294d21 100644 --- a/xCAT-server/lib/xcat/plugins/blade.pm +++ b/xCAT-server/lib/xcat/plugins/blade.pm @@ -3383,13 +3383,18 @@ sub process_request { ($tmp)=$sitetab->getAttribs({'key'=>'blademaxp'},'value'); if (defined($tmp)) { $blademaxp=$tmp->{value}; } } + if ($request->{environment}->[0]->{XCAT_BLADEUSER}) { + $bladeuser=$request->{environment}->[0]->{XCAT_BLADEUSER}->[0]; + $bladepass=$request->{environment}->[0]->{XCAT_BLADEPASS}->[0]; + } else { my $passtab = xCAT::Table->new('passwd'); - if ($passtab) { - ($tmp)=$passtab->getAttribs({'key'=>'blade'},'username','password'); - if (defined($tmp)) { - $bladeuser = $tmp->{username}; - $bladepass = $tmp->{password}; - } + if ($passtab) { + ($tmp)=$passtab->getAttribs({'key'=>'blade'},'username','password'); + if (defined($tmp)) { + $bladeuser = $tmp->{username}; + $bladepass = $tmp->{password}; + } + } } if ($request->{command}->[0] eq "findme") { my $mptab = xCAT::Table->new("mp");