2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-06-15 19:01:44 +00:00

enhance errror msg if -u or -p is none for teamsun task45786.

This commit is contained in:
amy0701
2015-06-04 23:40:23 -04:00
parent ae08f1e7cf
commit d776dd582f

View File

@ -224,11 +224,25 @@ sub bmcdiscovery_processargs {
#########################################
# Option -i -u -p -c should be used together
######################################
if ( defined($::opt_U) && defined($::opt_P) && defined($::opt_C) && defined($::opt_I) )
if ( defined($::opt_U) || defined($::opt_P) || defined($::opt_C) || defined($::opt_I) )
{
my $res=check_auth_process($::opt_I,$::opt_U,$::opt_P);
return $res;
if ( defined($::opt_U) && defined($::opt_P) && defined($::opt_C) && defined($::opt_I) )
{
my $res=check_auth_process($::opt_I,$::opt_U,$::opt_P);
return $res;
}
else
{
my $msg = "bmc_ip or bmcuser or bmcpw is empty.";
my $rsp = {};
push @{ $rsp->{data} }, "$msg";
xCAT::MsgUtils->message("E", $rsp, $::CALLBACK);
return 2;
}
}
#########################################
# Other attributes are not allowed
#########################################