From 234b633e0346c2a43d6df003d208ec72b62f2e64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20R=C3=B6hl?= Date: Sat, 13 Jul 2024 16:22:01 +0200 Subject: [PATCH] Fix some pylint warnings --- bottles/backend/models/btrfssubvolume.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/bottles/backend/models/btrfssubvolume.py b/bottles/backend/models/btrfssubvolume.py index 5c2936436b..8e7614caa4 100644 --- a/bottles/backend/models/btrfssubvolume.py +++ b/bottles/backend/models/btrfssubvolume.py @@ -86,7 +86,7 @@ def create_bare_destination() -> DuplicateResult: return DuplicateResult.NOTHING case btrfsutil.ERROR_SNAP_CREATE_FAILED: return create_bare_destination() - case other: + case _: raise error for internal_subvolume in _internal_subvolumes: internal_source_path = os.path.join(source_path, internal_subvolume) @@ -171,9 +171,9 @@ def read_active_snapshot_id(self) -> int: try: with open(self._active_snapshot_id_path(), "r") as file: return int(file.read()) - except OSError as error: + except OSError: return -1 - + def create_snapshot(self, description: str) -> int: snapshot_id = max(self._snapshots.keys(), default=-1) + 1 snapshot_path = self._snapshot_path2(snapshot_id, description) @@ -232,7 +232,7 @@ def convert_states(self): def is_initialized(self): # Nothing to initialize - return true + return True def re_initialize(self): # Nothing to initialize @@ -257,7 +257,7 @@ def list_states(self) -> Result: data={"state_id": active_state_id, "states": self.convert_states()}, message="Retrieved list of states", ) - + def set_state( self, state_id: int, after: callable ) -> Result: @@ -265,4 +265,3 @@ def set_state( if after: after() return Result(True) -