-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
This commit is contained in:
jbjohnso 2010-10-21 14:21:10 +00:00
parent 6e52a3cecc
commit 3ff385bd08

View File

@ -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");