From 6275ebdc0f5eb038d0823508104b6a966e483898 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Sat, 19 May 2012 13:46:25 +0000 Subject: [PATCH] rework password variable usage to allow the already discovered case to work git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@12819 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/slpdiscover.pm | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/slpdiscover.pm b/xCAT-server/lib/xcat/plugins/slpdiscover.pm index bc7a2a19c..2ab09a0e2 100644 --- a/xCAT-server/lib/xcat/plugins/slpdiscover.pm +++ b/xCAT-server/lib/xcat/plugins/slpdiscover.pm @@ -139,6 +139,7 @@ sub process_request { $addr .= "%".$data->{scopeid}; } $flexchassisuuid{$nodename}=$data->{attributes}->{"enclosure-uuid"}->[0]; + setup_cmm_pass($nodename); if ($machash{$nodename} =~ /$mac/i) { #ignore prospects already known to mac table configure_hosted_elements($nodename); next; @@ -219,11 +220,8 @@ sub configure_hosted_elements { } } -sub do_blade_setup { - my $data = shift; - my %args = @_; - my $addr = $args{curraddr}; - my $nodename = $data->{nodename}; +sub setup_cmm_pass { + my $nodename = shift; my $localuser=$defaultbladeuser; my $localpass=$defaultbladepass; if ($mpahash->{$nodename}) { @@ -234,6 +232,16 @@ sub do_blade_setup { $localuser = $mpahash->{$nodename}->[0]->{password}; } } + $passwordmap{$nodename}->{username}=$localuser; + $passwordmap{$nodename}->{password}=$localpass; +} +sub do_blade_setup { + my $data = shift; + my %args = @_; + my $addr = $args{curraddr}; + my $nodename = $data->{nodename}; + my $localuser=$passwordmap{$nodename}->{username}; + my $localpass=$passwordmap{$nodename}->{password}; if (not $localpass or $localpass eq "PASSW0RD") { sendmsg([1,":Password for blade must be specified in either mpa or passwd tables, and it must not be PASSW0RD"],$callback,$nodename); return 0; @@ -249,8 +257,6 @@ sub do_blade_setup { %exargs = ( defaultcfg=>1 ); } my $result; - $passwordmap{$nodename}->{username}=$localuser; - $passwordmap{$nodename}->{password}=$localpass; my $rc = eval { $result = xCAT_plugin::blade::clicmds( $nodename, $localuser,