2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-08-01 09:07:36 +00:00

mofidied depending on comments

This commit is contained in:
XuWei
2017-10-10 22:49:25 -04:00
parent b36c0ee19e
commit 8db826016c

View File

@@ -47,6 +47,8 @@ my $bmc_user;
my $bmc_pass;
my $openbmc_user;
my $openbmc_pass;
$::P9_WITHERSPOON_MFG_ID = "42817";
$::P9_WITHERSPOON_PRODUCT_ID = "16975";
#-------------------------------------------------------
@@ -667,14 +669,19 @@ sub scan_process {
# Set child process default, if not the function runcmd may return error
$SIG{CHLD} = 'DEFAULT';
my @mc_cmds = ("/opt/xcat/bin/ipmitool-xcat -I lanplus -H ${$live_ip}[$i] -P $openbmc_pass mc info",
"/opt/xcat/bin/ipmitool-xcat -I lanplus -H ${$live_ip}[$i] -U $bmc_user -P $bmc_pass mc info");
my $bmcusername;
my $bmcpassword;
$bmcusername = "-U $bmc_user" if ($bmc_user);
$bmcpassword = "-P $bmc_pass" if ($bmc_pass);
my @mc_cmds = ("/opt/xcat/bin/ipmitool-xcat -I lanplus -H ${$live_ip}[$i] -P $openbmc_pass mc info -N 1 -R 1",
"/opt/xcat/bin/ipmitool-xcat -I lanplus -H ${$live_ip}[$i] $bmcusername $bmcpassword mc info -N 1 -R 1");
my $mc_info;
my $flag;
foreach my $mc_cmd (@mc_cmds) {
$mc_info = xCAT::Utils->runcmd($mc_cmd, -1);
if ($mc_info =~ /Manufacturer ID\s*:\s*(\d+)\s*Manufacturer Name.+\s*Product ID\s*:\s*(\d+)/) {
if ($1 eq "42817" and $2 eq "16975") {
if ($1 eq $::P9_WITHERSPOON_MFG_ID and $2 eq $::P9_WITHERSPOON_PRODUCT_ID) {
bmcdiscovery_openbmc(${$live_ip}[$i], $opz, $opw, $request_command);
$flag = 1;
last;