From 9511704d8a18b068880b645f4ee4ba17d2a33c80 Mon Sep 17 00:00:00 2001 From: wanghuaz Date: Fri, 5 Mar 2010 09:53:24 +0000 Subject: [PATCH] Fixed one bug in rscan -u that it only updated HMC password, missing updating admin and general git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@5383 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/PPCdb.pm | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/perl-xCAT/xCAT/PPCdb.pm b/perl-xCAT/xCAT/PPCdb.pm index 43d42e462..d67265a0a 100644 --- a/perl-xCAT/xCAT/PPCdb.pm +++ b/perl-xCAT/xCAT/PPCdb.pm @@ -360,19 +360,21 @@ sub update_node_attribs ########################### # Update ppcdirect table ########################### - my $pwhash = $db->{ppcdirect}->getNodeAttribs( $predefined_node, [qw(username password comments disable)]); - if ( $pwhash) - { - if ( $namediff) + my @users = qw(HMC admin general); + foreach my $user ( @users ) { + my $pwhash = $db->{ppcdirect}->getAttribs( {hcp=>$predefined_node,username=>$user}, qw(password comments disable)); + if ( $pwhash ) { - $db->{ppcdirect}->delEntries( {hcp=>$predefined_node}) if ( $namediff);; - $db->{ppcdirect}->setAttribs({hcp=>$name}, - {username=>$pwhash->{username}, - password=>$pwhash->{password}, - comments=>$pwhash->{comments}, - disable=>$pwhash->{disable}}); - $db->{vpd}->{commit} = 1; - $updated = 1; + if ( $namediff ) + { + $db->{ppcdirect}->delEntries( {hcp=>$predefined_node,username=>$user}) if ( $namediff);; + $db->{ppcdirect}->setAttribs({hcp=>$name,username=>$user}, + {password=>$pwhash->{password}, + comments=>$pwhash->{comments}, + disable=>$pwhash->{disable}}); + $db->{ppcdirect}->{commit} = 1; + $updated = 1; + } } }