2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-07-30 16:21:11 +00:00

when no ipmitool-xcat tool, report error before go ahead the real discovery

This commit is contained in:
bxuxa
2018-11-16 12:39:50 +08:00
parent ed6852a9e4
commit 540ee9f262

View File

@@ -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 = {};