From 1dfaa463607151297b4f03abac7d5554b9d9c866 Mon Sep 17 00:00:00 2001 From: zhaoertao Date: Fri, 23 Mar 2012 08:42:48 +0000 Subject: [PATCH] fix bug 3510200: can use username other than USERID git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@11955 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/blade.pm | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/blade.pm b/xCAT-server/lib/xcat/plugins/blade.pm index d89b9fa63..9c75fba53 100644 --- a/xCAT-server/lib/xcat/plugins/blade.pm +++ b/xCAT-server/lib/xcat/plugins/blade.pm @@ -3911,7 +3911,16 @@ sub process_request { my $pass=$bladepass; my $ent; if (defined($mpatab)) { - ($ent)=$mpatab->getNodeSpecAttribs($mpa, {username=>"USERID"},qw(username password)); + #($ent)=$mpatab->getNodeSpecAttribs($mpa, {username=>"USERID"},qw(username password)); + my @user_array = $mpatab->getNodeAttribs($mpa, qw(username password)); + foreach my $entry (@user_array) { + if ($entry->{username}) { + if ($entry->{username} =~ /^USERID$/ or $entry->{username} !~ /^(HMC|general|admin)$/) { + $ent = $entry; + last; + } + } + } if (defined($ent->{password})) { $pass = $ent->{password}; } if (defined($ent->{username})) { $user = $ent->{username}; } }