From aaa62e33337957f5fbef9e13b479b5c52fd69015 Mon Sep 17 00:00:00 2001 From: XuWei Date: Wed, 21 Jun 2017 22:26:48 -0400 Subject: [PATCH] Modified judging condition of openbmc in bmcdiscover, if not open enter bmcdiscover_ipmi --- xCAT-server/lib/xcat/plugins/bmcdiscover.pm | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/bmcdiscover.pm b/xCAT-server/lib/xcat/plugins/bmcdiscover.pm index f1fb34b32..9cd5b02b7 100644 --- a/xCAT-server/lib/xcat/plugins/bmcdiscover.pm +++ b/xCAT-server/lib/xcat/plugins/bmcdiscover.pm @@ -587,18 +587,10 @@ sub scan_process { my $nmap_cmd = "nmap ${$live_ip}[$i] -p $openbmc_port -Pn"; my $nmap_output = xCAT::Utils->runcmd($nmap_cmd, -1); - if ($nmap_output =~ /$openbmc_port\/tcp (\w+)/) { - my $port_stat = $1; - if ($port_stat eq "open") { - bmcdiscovery_openbmc(${$live_ip}[$i], $opz, $opw, $request_command); - } else { - bmcdiscovery_ipmi(${$live_ip}[$i], $opz, $opw, $request_command); - } + if ($nmap_output =~ /$openbmc_port(.+)open/) { + bmcdiscovery_openbmc(${$live_ip}[$i], $opz, $opw, $request_command); } else { - my $rsp = {}; - push @{ $rsp->{data} }, "Can not get status of 2200 port for ip ${$live_ip}[$i].\n"; - xCAT::MsgUtils->message("E", $rsp, $::CALLBACK); - exit 1; + bmcdiscovery_ipmi(${$live_ip}[$i], $opz, $opw, $request_command); } exit 0;