From 7bffb9fe92a55705d08eb6874a586e7b50ec40c9 Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Wed, 13 Nov 2024 16:00:38 +0100 Subject: [PATCH] config: factor out method to get the absolute datastore path removable datastores will have a PBS-managed mountpoint as path, direct access to the field needs to be replaced with a helper that can account for this. Signed-off-by: Hannes Laimer --- pbs-api-types/src/datastore.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pbs-api-types/src/datastore.rs b/pbs-api-types/src/datastore.rs index 31767417..a5704c93 100644 --- a/pbs-api-types/src/datastore.rs +++ b/pbs-api-types/src/datastore.rs @@ -357,6 +357,11 @@ impl DataStoreConfig { } } + /// Returns the absolute path to the datastore content. + pub fn absolute_path(&self) -> String { + self.path.clone() + } + pub fn get_maintenance_mode(&self) -> Option { self.maintenance_mode.as_ref().and_then(|str| { MaintenanceMode::deserialize(proxmox_schema::de::SchemaDeserializer::new(