forked from third-party-mirrors/zfs_autobackup
another option that is unsupported in older versions
This commit is contained in:
parent
4d15f29b5b
commit
252086e2e6
@ -990,7 +990,7 @@ class ZfsDataset():
|
||||
#verbose output
|
||||
cmd.append("-v")
|
||||
|
||||
if 'extensible_dataset' in features:
|
||||
if 'extensible_dataset' in features and "-s" in self.zfs_node.supported_recv_options:
|
||||
#support resuming
|
||||
self.debug("Enabled resume support")
|
||||
cmd.append("-s")
|
||||
@ -1355,6 +1355,17 @@ class ZfsNode(ExecuteNode):
|
||||
ret.append(option)
|
||||
return(ret)
|
||||
|
||||
@cached_property
|
||||
def supported_recv_options(self):
|
||||
"""list of supported options"""
|
||||
#not every zfs implementation supports them all
|
||||
|
||||
ret=[]
|
||||
for option in ["-s" ]:
|
||||
if self.valid_command(["zfs","recv", option, "zfs_autobackup_option_test"]):
|
||||
ret.append(option)
|
||||
return(ret)
|
||||
|
||||
|
||||
def valid_command(self, cmd):
|
||||
"""test if a specified zfs options are valid exit code. use this to determine support options"""
|
||||
|
Loading…
x
Reference in New Issue
Block a user