2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-06-12 17:30:19 +00:00

Handle some warning messages based on this code

- isn't numeric in numeric ne (!=)
  - Scalar value @attr_value[-1] better written as $attr_value[-1]
This commit is contained in:
Victor Hu
2018-01-25 09:17:41 -05:00
parent d72c193710
commit e70ed0f3f0

View File

@ -1171,7 +1171,7 @@ sub parse_args {
my $all_subcommand = "";
foreach $subcommand (@ARGV) {
$::RSPCONFIG_CONFIGURED_API_KEY = &is_valid_config_api($subcommand, $callback);
if ($::RSPCONFIG_CONFIGURED_API_KEY != -1) {
if ($::RSPCONFIG_CONFIGURED_API_KEY ne -1) {
# subcommand defined in the configured API hash, return from here, the RSPCONFIG_CONFIGURED_API_KEY is the key into the hash
return;
}
@ -1574,7 +1574,7 @@ sub parse_command_status {
my @options = ();
my $num_subcommand = @$subcommands;
#Setup chain to process the configured command
if ($::RSPCONFIG_CONFIGURED_API_KEY != -1) {
if ($::RSPCONFIG_CONFIGURED_API_KEY ne -1) {
$subcommand = $$subcommands[0];
# Check if setting or quering
if ($subcommand =~ /^(\w+)=(.*)/) {
@ -3609,7 +3609,7 @@ sub rspconfig_api_config_response {
# For example "xyz.openbmc_project.Control.Power.RestorePolicy.Policy.Restore"
# will be displayed as "Restore"
my @attr_value = split('\.', $value);
my $last_component = @attr_value[-1];
my $last_component = $attr_value[-1];
my @valid_values = values $api_config_info{$::RSPCONFIG_CONFIGURED_API_KEY}{attr_value};
if ($value) {
if ($value ~~ @valid_values) {