From 24c4dda6acc2023e480a3883218425999cdce2da Mon Sep 17 00:00:00 2001 From: Vojtech Trefny Date: Wed, 22 May 2024 10:42:57 +0200 Subject: [PATCH] Fix pylint 'possibly-used-before-assignment' warnings New pylint, new issues found. --- blivetgui/blivet_utils.py | 2 ++ blivetgui/list_devices.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/blivetgui/blivet_utils.py b/blivetgui/blivet_utils.py index e2f0a089..f7682414 100644 --- a/blivetgui/blivet_utils.py +++ b/blivetgui/blivet_utils.py @@ -1209,6 +1209,8 @@ def _create_snapshot(self, user_input): parents=[origin_lv.pool], origin=origin_lv, seg_type="thin") + else: + raise ValueError("Creating snapshots is not supported for %s" % user_input.device_type) actions.append(blivet.deviceaction.ActionCreateDevice(new_snap)) diff --git a/blivetgui/list_devices.py b/blivetgui/list_devices.py index 2fd4a795..379f3947 100644 --- a/blivetgui/list_devices.py +++ b/blivetgui/list_devices.py @@ -125,6 +125,8 @@ def update_devices_view(self): model, treeiter = selection.get_selected() if treeiter and model: selected_device = model[treeiter][0].name + else: + selected_device = None # reload devices # adding new devices into TreeStore causing "changed" signal being