bundles/zfs: remove support for snapshot_only and snapshot_never (unused)

This commit is contained in:
Franzi 2021-02-13 08:36:10 +01:00
parent b20f369ea8
commit 2fbbaa1586
Signed by: kunsi
GPG key ID: 12E3D2136B818350
3 changed files with 2 additions and 77 deletions

View file

@ -31,14 +31,8 @@ label = argv[1]
with open('/etc/zfs-snapshot-config.json', 'r') as fp:
metadata = loads(fp.read())
if 'snapshot_only' in metadata:
datasets = set(metadata['snapshot_only'])
else:
output = check_output(['zfs', 'list', '-H', '-o', 'name']).decode('UTF-8')
datasets = set(output.splitlines())
for pattern in metadata.get('snapshot_never', set()):
datasets = set(filter(lambda x: not re.search(pattern, x), datasets))
output = check_output(['zfs', 'list', '-H', '-o', 'name']).decode('UTF-8')
datasets = set(output.splitlines())
default_retain = metadata['retain_defaults'][label]
now = datetime.now().strftime('%F-%H%M')