[pbs-devel] [PATCH proxmox-backup 5/5] get_disks: don't fail on zfs_devices

Dominik Csapak d.csapak at proxmox.com
Wed Jul 8 14:59:19 CEST 2020


zfs does not have to be installed, so simply log an error and
continue, users still get an error when clicking directly on
ZFS

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

diff --git a/src/tools/disks.rs b/src/tools/disks.rs
index a4c3e29..73f8370 100644
--- a/src/tools/disks.rs
+++ b/src/tools/disks.rs
@@ -743,7 +743,10 @@ pub fn get_disks(
 
     let partition_type_map = get_partition_type_info()?;
 
-    let zfs_devices = zfs_devices(&partition_type_map, None)?;
+    let zfs_devices = zfs_devices(&partition_type_map, None).or_else(|err| -> Result<HashSet<u64>, Error> {
+        eprintln!("error getting zfs devices: {}", err);
+        Ok(HashSet::new())
+    })?;
 
     let lvm_devices = get_lvm_devices(&partition_type_map)?;
 
-- 
2.20.1






More information about the pbs-devel mailing list