From c91904e30e584439ac7291b70105c9efea13e7b5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 4 Jun 2024 08:39:11 +0000 Subject: [PATCH 1/2] infra: bump the pylint-and-astroid group across 1 directory with 2 updates Bumps the pylint-and-astroid group with 2 updates in the /dockerfile directory: [pylint](https://github.com/pylint-dev/pylint) and [astroid](https://github.com/pylint-dev/astroid). Updates `pylint` from 3.1.0 to 3.2.2 - [Release notes](https://github.com/pylint-dev/pylint/releases) - [Commits](https://github.com/pylint-dev/pylint/compare/v3.1.0...v3.2.2) Updates `astroid` from 3.1.0 to 3.2.2 - [Release notes](https://github.com/pylint-dev/astroid/releases) - [Changelog](https://github.com/pylint-dev/astroid/blob/main/ChangeLog) - [Commits](https://github.com/pylint-dev/astroid/compare/v3.1.0...v3.2.2) --- updated-dependencies: - dependency-name: pylint dependency-type: direct:production update-type: version-update:semver-minor dependency-group: pylint-and-astroid - dependency-name: astroid dependency-type: direct:production update-type: version-update:semver-minor dependency-group: pylint-and-astroid ... Signed-off-by: dependabot[bot] --- dockerfile/anaconda-ci/requirements.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dockerfile/anaconda-ci/requirements.txt b/dockerfile/anaconda-ci/requirements.txt index e23818e9646..33568e980be 100644 --- a/dockerfile/anaconda-ci/requirements.txt +++ b/dockerfile/anaconda-ci/requirements.txt @@ -15,8 +15,8 @@ pyyaml jinja2 # pylint and its supporting libs -pylint == 3.1.0 -astroid == 3.1.0 +pylint == 3.2.2 +astroid == 3.2.2 # ruff for fast linting ruff == 0.4.7 From 6a12d159a79cb8a692c1e8f337014f3bcaf5ef6e Mon Sep 17 00:00:00 2001 From: Jiri Konecny Date: Tue, 4 Jun 2024 13:08:43 +0200 Subject: [PATCH 2/2] Fix issues for new pylint check The possibly-used-before-assignment was introduced in Pylint version 3.2.0. --- anaconda.py | 14 ++++++++++---- pyanaconda/modules/storage/bootloader/base.py | 2 ++ pyanaconda/ui/gui/spokes/lib/accordion.py | 3 ++- pyanaconda/ui/gui/spokes/user.py | 3 +++ 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/anaconda.py b/anaconda.py index 7a289864bcc..c6bfe2cecfc 100755 --- a/anaconda.py +++ b/anaconda.py @@ -36,10 +36,12 @@ def exitHandler(rebootData): from pyanaconda.core.process_watchers import WatchProcesses WatchProcesses.unwatch_all_processes() + # pylint: disable=possibly-used-before-assignment # pylint: disable=used-before-assignment if flags.usevnc: vnc.shutdownServer() + # pylint: disable=possibly-used-before-assignment # pylint: disable=used-before-assignment if "nokill" in kernel_arguments: util.vtActivate(1) @@ -52,13 +54,14 @@ def exitHandler(rebootData): uninhibit_screensaver() # Unsetup the payload, which most usefully unmounts live images + # pylint: disable=possibly-used-before-assignment if anaconda.payload: anaconda.payload.unsetup() # Collect all optical media. from pyanaconda.modules.common.constants.objects import DEVICE_TREE from pyanaconda.modules.common.structures.storage import DeviceData - device_tree = STORAGE.get_proxy(DEVICE_TREE) + device_tree = STORAGE.get_proxy(DEVICE_TREE) # pylint: disable=possibly-used-before-assignment optical_media = [] for device_name in device_tree.FindOpticalMedia(): @@ -79,15 +82,16 @@ def exitHandler(rebootData): anaconda.dbus_launcher.stop() # Clean up the PID file - if pidfile: + if pidfile: # pylint: disable=possibly-used-before-assignment pidfile.close() # Reboot the system. - if conf.system.can_reboot: + if conf.system.can_reboot: # pylint: disable=possibly-used-before-assignment from pykickstart.constants import KS_SHUTDOWN, KS_WAIT if flags.eject or rebootData.eject: for device_path in optical_media: + # pylint: disable=possibly-used-before-assignment if path.get_mount_paths(device_path): util.dracut_eject(device_path) @@ -150,7 +154,9 @@ def setup_environment(): if "DISPLAY" in os.environ: flags.preexisting_x11 = True else: - os.environ["DISPLAY"] = ":%s" % constants.X_DISPLAY_NUMBER # pylint: disable=used-before-assignment + # This line is too long, unfortunately this disable won't work when used on above line + # pylint: disable=used-before-assignment + os.environ["DISPLAY"] = ":%s" % constants.X_DISPLAY_NUMBER # pylint: disable=possibly-used-before-assignment # We mostly don't run from bash, so it won't load the file for us, and libreport will then # show vi instead of nano. Resolves https://bugzilla.redhat.com/show_bug.cgi?id=1889674 diff --git a/pyanaconda/modules/storage/bootloader/base.py b/pyanaconda/modules/storage/bootloader/base.py index dfe329b79b7..ff527836d6e 100644 --- a/pyanaconda/modules/storage/bootloader/base.py +++ b/pyanaconda/modules/storage/bootloader/base.py @@ -850,6 +850,8 @@ def _set_storage_boot_args(self, storage): if device != dep and not device.depends_on(dep): continue + setup_args = None + if isinstance(dep, blivet.devices.FcoeDiskDevice): log.debug("Getting dracut arguments for FCoE device %s", dep) setup_args = fcoe_proxy.GetDracutArguments(dep.nic) diff --git a/pyanaconda/ui/gui/spokes/lib/accordion.py b/pyanaconda/ui/gui/spokes/lib/accordion.py index bd5a715e7b6..7b0e8c99989 100644 --- a/pyanaconda/ui/gui/spokes/lib/accordion.py +++ b/pyanaconda/ui/gui/spokes/lib/accordion.py @@ -316,6 +316,8 @@ def process_event(self, selector, event, cb): gi.require_version("Gdk", "3.0") from gi.repository import Gdk + old_selector = self.current_selector + if event: if event.type not in [Gdk.EventType.BUTTON_PRESS, Gdk.EventType.KEY_RELEASE, Gdk.EventType.FOCUS_CHANGE]: @@ -325,7 +327,6 @@ def process_event(self, selector, event, cb): event.keyval not in [Gdk.KEY_space, Gdk.KEY_Return, Gdk.KEY_ISO_Enter, Gdk.KEY_KP_Enter, Gdk.KEY_KP_Space]: return - old_selector = self.current_selector # deal with multiselection state = event.get_state() if state & Gdk.ModifierType.CONTROL_MASK: # holding CTRL diff --git a/pyanaconda/ui/gui/spokes/user.py b/pyanaconda/ui/gui/spokes/user.py index d53cfa3049d..52f7a464a3c 100644 --- a/pyanaconda/ui/gui/spokes/user.py +++ b/pyanaconda/ui/gui/spokes/user.py @@ -114,6 +114,9 @@ def refresh(self): homedir = self.user.homedir elif self.user.name: homedir = "/home/" + self.user.name + else: + # this state shouldn't happen + raise ValueError("Can't resolve home directory") self._tHome.set_text(homedir) self._origHome = homedir