mirror of
https://github.com/psy0rz/zfs_autobackup.git
synced 2025-06-09 01:52:07 +03:00
nicer errors
This commit is contained in:
parent
75161c1bd2
commit
f9d3576752
@ -225,6 +225,8 @@ class ZfsCheck(CliBase):
|
|||||||
if "@" in self.args.target:
|
if "@" in self.args.target:
|
||||||
# zfs snapshot
|
# zfs snapshot
|
||||||
snapshot=self.node.get_dataset(self.args.target)
|
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']
|
dataset_type = snapshot.parent.properties['type']
|
||||||
|
|
||||||
if dataset_type == 'volume':
|
if dataset_type == 'volume':
|
||||||
@ -239,6 +241,9 @@ class ZfsCheck(CliBase):
|
|||||||
if "@" in self.args.target:
|
if "@" in self.args.target:
|
||||||
# zfs snapshot
|
# zfs snapshot
|
||||||
snapshot=self.node.get_dataset(self.args.target)
|
snapshot=self.node.get_dataset(self.args.target)
|
||||||
|
if not snapshot.exists:
|
||||||
|
return
|
||||||
|
|
||||||
dataset_type = snapshot.parent.properties['type']
|
dataset_type = snapshot.parent.properties['type']
|
||||||
|
|
||||||
if dataset_type == 'volume':
|
if dataset_type == 'volume':
|
||||||
|
Loading…
x
Reference in New Issue
Block a user