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 <h.laimer@proxmox.com>
This commit is contained in:
Dietmar Maurer 2024-11-13 16:00:38 +01:00 committed by Thomas Lamprecht
parent cba72020dd
commit 7bffb9fe92

View File

@ -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<MaintenanceMode> {
self.maintenance_mode.as_ref().and_then(|str| {
MaintenanceMode::deserialize(proxmox_schema::de::SchemaDeserializer::new(