From b608dea24a9f178d3f1e47bdc72411e501fac447 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Mon, 22 Jan 2018 11:20:52 -0500 Subject: [PATCH 1/2] Support rspconfig powersupplyredundancy --- xCAT-server/lib/xcat/plugins/openbmc.pm | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index 66579089e..0c61f2d34 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -578,10 +578,14 @@ my %api_config_info = ( RSPCONFIG_POWERSUPPLY_REDUNDENCY => { command => "rspconfig", url => "/sensors/chassis/PowerSupplyRedundancy", - attr_url => "PowerSupplyRedundency", - display_name => "PowerSupplyRedundency", - type => "boolean", - subcommand => "powersupplyredundency", + attr_url => "value", + display_name => "PowerSupplyRedundancy", + type => "attribute", + subcommand => "powersupplyredundancy", + attr_value => { + enabled => "Enabled", + disabled => "Disabled", + }, }, RSPCONFIG_POWERRESTORE_POLICY => { command => "rspconfig", From 5d91fe37786ddd3e04a5c4ca26860c7d639786e8 Mon Sep 17 00:00:00 2001 From: zet809 Date: Tue, 23 Jan 2018 00:49:41 -0500 Subject: [PATCH 2/2] modify rspconfig powersupplyredundancy based on comments --- xCAT-server/lib/xcat/plugins/openbmc.pm | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index 0c61f2d34..ff47461ba 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -571,15 +571,15 @@ my %api_config_info = ( command => "rspconfig", url => "/control/host0/auto_reboot", attr_url => "AutoReboot", - display_name => "AutoReboot", + display_name => "BMC AutoReboot", type => "boolean", subcommand => "autoreboot", }, - RSPCONFIG_POWERSUPPLY_REDUNDENCY => { + RSPCONFIG_POWERSUPPLY_REDUNDANCY => { command => "rspconfig", url => "/sensors/chassis/PowerSupplyRedundancy", attr_url => "value", - display_name => "PowerSupplyRedundancy", + display_name => "BMC PowerSupplyRedundancy", type => "attribute", subcommand => "powersupplyredundancy", attr_value => { @@ -591,7 +591,7 @@ my %api_config_info = ( command => "rspconfig", url => "/control/host0/power_restore_policy", attr_url => "PowerRestorePolicy", - display_name => "PowerRestorePolicy", + display_name => "BMC PowerRestorePolicy", type => "attribute", subcommand => "powerrestorepolicy", attr_value => { @@ -4448,10 +4448,8 @@ sub is_valid_config_api { $subcommand_value = $2; } foreach my $config_subcommand (keys %api_config_info) { - foreach my $config_attribute (keys %{ $api_config_info{$config_subcommand} }) { - if ($subcommand_key eq $api_config_info{$config_subcommand}{subcommand}) { - return $config_subcommand; - } + if ($subcommand_key eq $api_config_info{$config_subcommand}{subcommand}) { + return $config_subcommand; } } return -1;