mirror of
https://github.com/xcat2/xcat-core.git
synced 2025-06-14 02:10:23 +00:00
Simplify code based on review comment
This commit is contained in:
@ -96,6 +96,7 @@ my %sensor_units = (
|
||||
my $http_protocol="https";
|
||||
my $openbmc_url = "/org/openbmc";
|
||||
my $openbmc_project_url = "/xyz/openbmc_project";
|
||||
$::SOFTWARE_URL = "$openbmc_project_url/software";
|
||||
#-------------------------------------------------------
|
||||
|
||||
# The hash table to store method and url for request,
|
||||
@ -161,7 +162,6 @@ my %status_info = (
|
||||
RFLASH_UPDATE_ACTIVATE_REQUEST => {
|
||||
method => "PUT",
|
||||
init_url => "$openbmc_project_url/software",
|
||||
orig_url => "$openbmc_project_url/software",
|
||||
data => "xyz.openbmc_project.Software.Activation.RequestedActivations.Active",
|
||||
},
|
||||
RFLASH_UPDATE_ACTIVATE_RESPONSE => {
|
||||
@ -170,7 +170,6 @@ my %status_info = (
|
||||
RFLASH_UPDATE_CHECK_STATE_REQUEST => {
|
||||
method => "GET",
|
||||
init_url => "$openbmc_project_url/software",
|
||||
orig_url => "$openbmc_project_url/software",
|
||||
},
|
||||
RFLASH_UPDATE_CHECK_STATE_RESPONSE => {
|
||||
process => \&rflash_response,
|
||||
@ -185,7 +184,6 @@ my %status_info = (
|
||||
RFLASH_SET_PRIORITY_REQUEST => {
|
||||
method => "PUT",
|
||||
init_url => "$openbmc_project_url/software",
|
||||
orig_url => "$openbmc_project_url/software",
|
||||
data => "false", # Priority state of 0 sets image to active
|
||||
},
|
||||
RFLASH_SET_PRIORITY_RESPONSE => {
|
||||
@ -2090,11 +2088,11 @@ sub rflash_response {
|
||||
|
||||
# Set the image id for the activation request
|
||||
$status_info{RFLASH_UPDATE_ACTIVATE_REQUEST}{init_url} =
|
||||
$status_info{RFLASH_UPDATE_ACTIVATE_REQUEST}{orig_url} . "/$update_id/attr/RequestedActivation";
|
||||
$::SOFTWARE_URL . "/$update_id/attr/RequestedActivation";
|
||||
$status_info{RFLASH_UPDATE_CHECK_STATE_REQUEST}{init_url} =
|
||||
$status_info{RFLASH_UPDATE_CHECK_STATE_REQUEST}{orig_url} . "/$update_id";
|
||||
$::SOFTWARE_URL . "/$update_id";
|
||||
$status_info{RFLASH_SET_PRIORITY_REQUEST}{init_url} =
|
||||
$status_info{RFLASH_SET_PRIORITY_REQUEST}{orig_url} . "/$update_id/attr/Priority";
|
||||
$::SOFTWARE_URL . "/$update_id/attr/Priority";
|
||||
|
||||
# Set next steps to activate the image
|
||||
$next_status{ $node_info{$node}{cur_status} } = "RFLASH_UPDATE_ACTIVATE_REQUEST";
|
||||
|
Reference in New Issue
Block a user