cleanup, black
This commit is contained in:
+3
-5
@@ -105,10 +105,6 @@ class ZFSPath:
|
|||||||
def replace_pool(self, pool: str) -> ZFSPath:
|
def replace_pool(self, pool: str) -> ZFSPath:
|
||||||
return ZFSPath([pool] + self._elements[1:], self.snapname)
|
return ZFSPath([pool] + self._elements[1:], self.snapname)
|
||||||
|
|
||||||
# @property
|
|
||||||
# def pool_name(self) -> str:
|
|
||||||
# return self._elements[0]
|
|
||||||
#
|
|
||||||
@property
|
@property
|
||||||
def name_without_pool(self) -> str:
|
def name_without_pool(self) -> str:
|
||||||
name = "/".join(self._elements[1:])
|
name = "/".join(self._elements[1:])
|
||||||
@@ -380,7 +376,9 @@ class Dataset:
|
|||||||
|
|
||||||
def _clean_old_snapshots_for_interval(self, interval: str, max_count: int):
|
def _clean_old_snapshots_for_interval(self, interval: str, max_count: int):
|
||||||
regex = ".*".join(["", config.snapshot_tag, interval, ""])
|
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:
|
if len(snapshots) > max_count:
|
||||||
snapshots.sort()
|
snapshots.sort()
|
||||||
for snap in snapshots[:-max_count]:
|
for snap in snapshots[:-max_count]:
|
||||||
|
|||||||
Reference in New Issue
Block a user