From f9d3576752a905843ff8da856b73c67b9330d3a6 Mon Sep 17 00:00:00 2001 From: Edwin Eefting Date: Tue, 8 Mar 2022 17:35:51 +0100 Subject: [PATCH] nicer errors --- zfs_autobackup/ZfsCheck.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/zfs_autobackup/ZfsCheck.py b/zfs_autobackup/ZfsCheck.py index 1d7d81a..c4d6f1c 100644 --- a/zfs_autobackup/ZfsCheck.py +++ b/zfs_autobackup/ZfsCheck.py @@ -225,6 +225,8 @@ class ZfsCheck(CliBase): if "@" in self.args.target: # zfs snapshot snapshot=self.node.get_dataset(self.args.target) + if not snapshot.exists: + raise Exception("ZFS snapshot {} does not exist!".format(snapshot)) dataset_type = snapshot.parent.properties['type'] if dataset_type == 'volume': @@ -239,6 +241,9 @@ class ZfsCheck(CliBase): if "@" in self.args.target: # zfs snapshot snapshot=self.node.get_dataset(self.args.target) + if not snapshot.exists: + return + dataset_type = snapshot.parent.properties['type'] if dataset_type == 'volume':