From 540ee9f2629970159be074043bba8292348a6b0a Mon Sep 17 00:00:00 2001 From: bxuxa Date: Fri, 16 Nov 2018 12:39:50 +0800 Subject: [PATCH] when no ipmitool-xcat tool, report error before go ahead the real discovery --- xCAT-server/lib/xcat/plugins/bmcdiscover.pm | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/bmcdiscover.pm b/xCAT-server/lib/xcat/plugins/bmcdiscover.pm index 5d9798132..a16765531 100644 --- a/xCAT-server/lib/xcat/plugins/bmcdiscover.pm +++ b/xCAT-server/lib/xcat/plugins/bmcdiscover.pm @@ -322,22 +322,29 @@ sub bmcdiscovery_processargs { ###################################### # check if there is nmap or not ###################################### - if (-x '/usr/bin/nmap') - { + if (-x '/usr/bin/nmap') { $nmap_path = "/usr/bin/nmap"; } - elsif (-x '/usr/local/bin/nmap') - { + elsif (-x '/usr/local/bin/nmap') { $nmap_path = "/usr/local/bin/nmap"; } - else - { + else { my $rsp; push @{ $rsp->{data} }, "\tThere is no nmap in /usr/bin/ or /usr/local/bin/. \n "; xCAT::MsgUtils->message("E", $rsp, $::CALLBACK); return 1; } + ###################################### + # check if there is ipmitool-xcat or not + ###################################### + unless (-x '/opt/xcat/bin/ipmitool-xcat') { + my $rsp; + push @{ $rsp->{data} }, "\tThere is no ipmitool-xcat in /opt/xcat/bin/, make sure that package ipmitool-xcat is installed successfully.\n "; + xCAT::MsgUtils->message("E", $rsp, $::CALLBACK); + return 1; + } + if ($::opt_T) { my $msg = "The -t option is deprecated and will be ignored"; my $rsp = {};