Skip to content

Commit b5e1ebf

Browse files
committed
provisioning: Require a disk to create partition tables on
Signed-off-by: Ikey Doherty <[email protected]>
1 parent 0e8e8f6 commit b5e1ebf

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

crates/provisioning/src/commands/create_partition_table.rs

+7-2
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,25 @@
22
//
33
// SPDX-License-Identifier: MPL-2.0
44

5-
use crate::Context;
65
use crate::{get_kdl_property, FromKdlProperty, PartitionTableType};
6+
use crate::{get_property_str, Context};
77

88
/// Command to create a partition table
99
#[derive(Debug)]
1010
pub struct Command {
1111
/// The type of partition table to create
1212
pub table_type: PartitionTableType,
13+
pub disk: String,
1314
}
1415

1516
/// Generate a command to create a partition table
1617
pub(crate) fn parse(context: Context<'_>) -> Result<super::Command, crate::Error> {
1718
let kind = get_kdl_property(context.node, "type")?;
1819
let table_type = PartitionTableType::from_kdl_property(kind)?;
20+
let disk = get_property_str(context.node, "disk")?;
1921

20-
Ok(super::Command::CreatePartitionTable(Box::new(Command { table_type })))
22+
Ok(super::Command::CreatePartitionTable(Box::new(Command {
23+
table_type,
24+
disk,
25+
})))
2126
}

0 commit comments

Comments
 (0)