From d2a1d9da612fd698370e5a0cc040c42aca971c28 Mon Sep 17 00:00:00 2001 From: yinle Date: Fri, 8 Apr 2011 03:29:19 +0000 Subject: [PATCH] Move credential to the hmc.pm git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@9248 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/hmc.pm | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/xCAT-server/lib/xcat/plugins/hmc.pm b/xCAT-server/lib/xcat/plugins/hmc.pm index 241cf2b1a..775e0440e 100644 --- a/xCAT-server/lib/xcat/plugins/hmc.pm +++ b/xCAT-server/lib/xcat/plugins/hmc.pm @@ -140,10 +140,25 @@ sub gethmccon { return ; } } + ################################ + # Get username and passwd + ################################ + my $hwtype = "hmc"; + my $host = $att->{hcp}; + my @cred = xCAT::PPCdb::credentials( $host, $hwtype ); + if ( !defined(@cred) ) + { + $rsp->{node}->[0]->{error}=["Can't username and passwd for the hmc"]; + $rsp->{node}->[0]->{errorcode}=[1]; + $callback->($rsp); + return; + } + $rsp = {node=>[{name=>[$node]}]}; $rsp->{node}->[0]->{mtms}->[0] = "$vpd->{mtm}*$vpd->{serial}"; $rsp->{node}->[0]->{host}->[0] = $att->{hcp}; $rsp->{node}->[0]->{lparid}->[0] = $att->{id}; + $rsp->{node}->[0]->{cred}->[0] = join ',', @cred; $callback->($rsp); }