workaround cleaning stale snapshots
This commit is contained in:
+3
-2
@@ -679,6 +679,7 @@ class ExternalPool(Pool):
|
||||
exit(EXIT_ERROR)
|
||||
|
||||
def clean_old_snapshots(self) -> None:
|
||||
return # this seems to be broken TODO
|
||||
print("Cleaning old snapshots")
|
||||
for dataset in self.datasets:
|
||||
dataset.clean_old_snapshots()
|
||||
@@ -721,7 +722,7 @@ class Dataset:
|
||||
for interval, number in config.keep_snapshots_per_interval.items():
|
||||
self._clean_old_snapshots_for_interval(interval, number)
|
||||
|
||||
def _clean_old_snapshots_for_interval(self, interval: str, max_count: int) -> None:
|
||||
def _clean_old_snapshots_for_interval(self, interval: str, max_count: int) -> None: # TODO I assume the regex matches across different datasets, which it shouldn't
|
||||
regex = _get_regex_matching_snapshots_with_tags([config.snapshot_tag, interval])
|
||||
snapshots = [
|
||||
snapshot for snapshot in self.snapshots if snapshot.matches_regex(regex)
|
||||
@@ -752,7 +753,7 @@ class Snapshot:
|
||||
def __repr__(self):
|
||||
return str(self._path)
|
||||
|
||||
def __eq__(self, other: ZFSPath):
|
||||
def __eq__(self, other: Snapshot):
|
||||
return self._path == other._path
|
||||
|
||||
def newer_than(self, other: Snapshot) -> bool:
|
||||
|
||||
Reference in New Issue
Block a user