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

@ -52,10 +52,6 @@ defaults = {
'datasets': {},
'pools': {},
'snapshots': {
# 'backup': {
# 'enabled': True,
# 'filesystems_with_snapshot': {},
# },
'retain_defaults': {
'hourly': 24,
'daily': 7,
@ -99,47 +95,6 @@ def zfs_scrub_cronjob(metadata):
}
# TODO
#@metadata_reactor
#def zfs_snapshot_backup(metadata):
# if metadata.get('zfs/snapshots/backup/enabled'):
# # Collect all filesystems/datasets (e.g., "tank/mysql") which
# # are configured for (local) snapshots. For each of them, store
# # the mountpoint. This information will be used primarily by
# # "/usr/local/sbin/zfs-backup-snapshot", but may also be used by
# # other bundles (think backup tools).
# #
# # In other words, this API allows other bundles to check whether
# # a path belongs to a ZFS dataset with snapshots enabled.
#
# filesystems = {}
#
# if metadata.get('zfs/snapshots/snapshot_only', None) is not None:
# for name in metadata.get('zfs/snapshots/snapshot_only'):
# attrs = metadata.get('zfs/datasets')[name]
# if attrs.get('mountpoint') not in (None, "none"):
# filesystems[name] = attrs['mountpoint']
# else:
# for name, attrs in metadata.get('zfs/datasets').items():
# if attrs.get('mountpoint') not in (None, "none"):
# filesystems[name] = attrs['mountpoint']
#
# for pattern in metadata.get('zfs/snapshots/snapshot_never', set()):
# filesystems = {k: v for k, v in filesystems.items() if not re.search(pattern, k)}
#
# return {
# 'zfs': {
# 'snapshots': {
# 'backup': {
# 'filesystems_with_snapshot': filesystems,
# },
# },
# },
# }
# else:
# return {}
@metadata_reactor
def monitoring(metadata):
if not node.has_bundle('sshmon'):