Skip to content

Commit 70fc0c4

Browse files
committed
fix: [Dell] new volume creation payload + deserialize chassis power_state properly
Signed-off-by: Krish Dandiwala <kdandiwala@nvidia.com>
1 parent 2a90ec8 commit 70fc0c4

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/dell.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2163,11 +2163,11 @@ impl Bmc {
21632163
self.lifecycle_controller_is_ready().await?;
21642164

21652165
let url: String = format!("Systems/System.Embedded.1/Storage/{controller_id}/Volumes");
2166-
let mut arg = HashMap::new();
2167-
2168-
arg.insert("Name", Value::String(volume_name.to_string()));
2169-
arg.insert("RAIDType", Value::String(raid_type.to_string()));
2170-
arg.insert("Drives", drive_info);
2166+
let arg = HashMap::from([
2167+
("Name", Value::String(volume_name.to_string())),
2168+
("RAIDType", Value::String(raid_type.to_string())),
2169+
("Links", serde_json::json!({ "Drives": drive_info })),
2170+
]);
21712171

21722172
match self.s.client.post(&url, arg).await? {
21732173
(_, Some(headers)) => self.parse_job_id_from_response_headers(&url, headers).await,

src/model/chassis.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ use tracing::debug;
2626

2727
use super::oem::ChassisExtensions;
2828
use super::resource::OData;
29-
use super::{ODataId, ODataLinks, OnOff, PCIeFunction, ResourceStatus};
29+
use super::{ODataId, ODataLinks, PCIeFunction, PowerState, ResourceStatus};
3030
use crate::NetworkDeviceFunction;
3131

3232
#[derive(Debug, Serialize, Deserialize, Clone)]
@@ -117,7 +117,7 @@ pub struct Chassis {
117117
pub part_number: Option<String>,
118118
pub power: Option<ODataId>,
119119
#[serde(default)] // Viking returns Chassis w.o power_state, so default will be used
120-
pub power_state: Option<OnOff>,
120+
pub power_state: Option<PowerState>,
121121
pub power_subsystem: Option<ODataId>,
122122
pub sensors: Option<ODataId>,
123123
pub serial_number: Option<String>,

0 commit comments

Comments
 (0)