nicer errors

This commit is contained in:
Edwin Eefting 2022-03-08 17:35:51 +01:00
parent 75161c1bd2
commit f9d3576752

View File

@ -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':