[pbs-devel] [PATCH proxmox-backup 2/2] datastore: improve error on maintenance mode failure with empty message

Dominik Csapak d.csapak at proxmox.com
Fri Nov 19 16:23:28 CET 2021


Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 pbs-datastore/src/datastore.rs | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/pbs-datastore/src/datastore.rs b/pbs-datastore/src/datastore.rs
index 9cb19e79..e03935bd 100644
--- a/pbs-datastore/src/datastore.rs
+++ b/pbs-datastore/src/datastore.rs
@@ -214,7 +214,11 @@ impl DataStore {
         match (&config.maintenance_type, operation.clone()) {
             (Some(MaintenanceType::ReadOnly(message)), Some(Operation::Write))
             | (Some(MaintenanceType::Offline(message)), Some(_)) => {
-                bail!("Datastore '{}' is in maintenance mode: {}", name, message);
+                if message.is_empty() {
+                    bail!("Datastore '{}' is in maintenance mode", name);
+                } else {
+                    bail!("Datastore '{}' is in maintenance mode: {}", name, message);
+                }
             },
             (_, Some(operation)) => update_active_operations(name, operation, 1)?,
             _ => {}
-- 
2.30.2






More information about the pbs-devel mailing list