From 6133755f27ea43157b2b8bffa303d42466dfaf8c Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Tue, 30 Aug 2016 13:42:21 -0400 Subject: [PATCH] Seems like for discovery of FSP and TUL servers, there is no bmcuser name so adding the code from commit 3f54b456d2f2479489386b9291fa1867dd22c32d and d82e14b56656482279d58e38295a9900e82ba056 to set the default user breaks that function. Reverting back to the old ways --- xCAT-server/lib/xcat/plugins/bmcdiscover.pm | 39 ++++++++++++++------- 1 file changed, 26 insertions(+), 13 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/bmcdiscover.pm b/xCAT-server/lib/xcat/plugins/bmcdiscover.pm index 608bc9092..c07f29ad1 100644 --- a/xCAT-server/lib/xcat/plugins/bmcdiscover.pm +++ b/xCAT-server/lib/xcat/plugins/bmcdiscover.pm @@ -204,24 +204,19 @@ sub bmcdiscovery_processargs { return 1; } - # - # Get the default bmc account from passwd table - # - ($bmc_user, $bmc_pass) = bmcaccount_from_passwd(); - - # overwrite the default user/pass with what is passed in - if ($::opt_U) { - $bmc_user = $::opt_U; - } - if ($::opt_P) { - $bmc_pass = $::opt_P; - } - ######################################### # Option -s -r should be together ###################################### if (defined($::opt_R)) { + # Option -c should not be used with -r + if (defined($::opt_C)) { + my $msg = "The 'check' and 'range' option cannot be used together."; + my $rsp = {}; + push @{ $rsp->{data} }, "$msg"; + xCAT::MsgUtils->message("E", $rsp, $::CALLBACK); + return 2; + } ###################################### # check if there is nmap or not ###################################### @@ -240,6 +235,24 @@ sub bmcdiscovery_processargs { xCAT::MsgUtils->message("E", $rsp, $::CALLBACK); return 1; } + + # + # Get the default bmc account from passwd table, this is only done for the + # discovery process + # + ($bmc_user, $bmc_pass) = bmcaccount_from_passwd(); + # overwrite the default password if one is provided + if ($::opt_U) { + $bmc_user = $::opt_U; + } else { + # If password is provided, but no user, set the user to blank + # Support older FSP and Tuletta machines + $bmc_user = ''; + } + if ($::opt_P) { + $bmc_pass = $::opt_P; + } + scan_process($::opt_M, $::opt_R, $::opt_Z, $::opt_W, $request_command); return 0; }