cleanup, black

This commit is contained in:
timeshifter
2021-11-26 13:46:48 +01:00
parent 73465ebab3
commit 3f26d4776e
+3 -5
View File
@@ -105,10 +105,6 @@ class ZFSPath:
def replace_pool(self, pool: str) -> ZFSPath:
return ZFSPath([pool] + self._elements[1:], self.snapname)
# @property
# def pool_name(self) -> str:
# return self._elements[0]
#
@property
def name_without_pool(self) -> str:
name = "/".join(self._elements[1:])
@@ -380,7 +376,9 @@ class Dataset:
def _clean_old_snapshots_for_interval(self, interval: str, max_count: int):
regex = ".*".join(["", config.snapshot_tag, interval, ""])
snapshots = [snapshot for snapshot in self.snapshots if snapshot.matches_regex(regex)]
snapshots = [
snapshot for snapshot in self.snapshots if snapshot.matches_regex(regex)
]
if len(snapshots) > max_count:
snapshots.sort()
for snap in snapshots[:-max_count]: