[pbs-devel] [PATCH v4 proxmox-backup 4/6] api2: make maintenance_type updatable
Hannes Laimer
h.laimer at proxmox.com
Fri Nov 12 13:30:17 CET 2021
---
v3->v4: remove check for conflicting tasks. Tasks should not perform
lookups after they have started, therefore alreday running tasks will
not be interupted by an updated maintenance type.
src/api2/config/datastore.rs | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/api2/config/datastore.rs b/src/api2/config/datastore.rs
index b9367469..b410a31f 100644
--- a/src/api2/config/datastore.rs
+++ b/src/api2/config/datastore.rs
@@ -183,6 +183,8 @@ pub enum DeletableProperty {
notify_user,
/// Delete the notify property
notify,
+ /// Delete the maintenance-type property
+ maintenance_type,
}
#[api(
@@ -249,6 +251,7 @@ pub fn update_datastore(
DeletableProperty::verify_new => { data.verify_new = None; },
DeletableProperty::notify => { data.notify = None; },
DeletableProperty::notify_user => { data.notify_user = None; },
+ DeletableProperty::maintenance_type => { data.maintenance_type = None; },
}
}
}
@@ -294,6 +297,8 @@ pub fn update_datastore(
if update.notify_user.is_some() { data.notify_user = update.notify_user; }
+ if update.maintenance_type.is_some() { data.maintenance_type = update.maintenance_type; }
+
config.set_data(&name, "datastore", &data)?;
pbs_config::datastore::save_config(&config)?;
--
2.30.2
More information about the pbs-devel
mailing list