From 8c303396d5e4ac8c1cb376289005a05e6c068e55 Mon Sep 17 00:00:00 2001 From: Jan Pokorny Date: Thu, 8 Aug 2024 10:19:34 +0200 Subject: [PATCH] fixes to previous commit (to be squashed) - removed leftover debug messages from test_fsset.py - removed unused imports from fsset.py - changed variable's names to correct values in root.py - increased required blivet version in spec file --- pyanaconda/modules/storage/devicetree/fsset.py | 7 +++---- pyanaconda/modules/storage/devicetree/root.py | 4 ++-- tests/gettext_tests/style_guide.py | 3 --- .../pyanaconda_tests/modules/storage/test_fsset.py | 3 --- 4 files changed, 5 insertions(+), 12 deletions(-) diff --git a/pyanaconda/modules/storage/devicetree/fsset.py b/pyanaconda/modules/storage/devicetree/fsset.py index cace6f733da..e09e2e8f708 100644 --- a/pyanaconda/modules/storage/devicetree/fsset.py +++ b/pyanaconda/modules/storage/devicetree/fsset.py @@ -21,14 +21,13 @@ from blivet import blockdev from blivet.fstab import FSTabManager -from blivet.devices import NoDevice, DirectoryDevice, NFSDevice, FileDevice, MDRaidArrayDevice, \ +from blivet.devices import NoDevice, DirectoryDevice, FileDevice, MDRaidArrayDevice, \ NetworkStorageDevice, OpticalDevice -from blivet.errors import UnrecognizedFSTabEntryError, FSTabTypeMismatchError, SwapSpaceError -from blivet.formats import get_format, get_device_format_class +from blivet.errors import UnrecognizedFSTabEntryError, SwapSpaceError +from blivet.formats import get_format from blivet.storage_log import log_exception_info from pyanaconda.core.configuration.anaconda import conf -from pyanaconda.core.i18n import _ from pyanaconda.modules.storage.platform import platform, EFI from pyanaconda.anaconda_loggers import get_module_logger diff --git a/pyanaconda/modules/storage/devicetree/root.py b/pyanaconda/modules/storage/devicetree/root.py index 63da232ac0c..375fce8e3f2 100644 --- a/pyanaconda/modules/storage/devicetree/root.py +++ b/pyanaconda/modules/storage/devicetree/root.py @@ -287,8 +287,8 @@ def _parse_fstab(devicetree, chroot): continue # If a btrfs volume is found but a subvolume is expected, ignore the volume. - if device.type == "btrfs volume" and "subvol=" in options: - log.debug("subvolume from %s for %s not found", options, devspec) + if device.type == "btrfs volume" and "subvol=" in entry.mntops: + log.debug("subvolume from %s for %s not found", entry.mntops, entry.spec) continue if entry.vfstype != "swap": diff --git a/tests/gettext_tests/style_guide.py b/tests/gettext_tests/style_guide.py index b605778b29d..623206f3ffc 100755 --- a/tests/gettext_tests/style_guide.py +++ b/tests/gettext_tests/style_guide.py @@ -62,9 +62,6 @@ 'pyanaconda/startup_utils.py': { 'HOSTNAME': 1, # ssh to install@HOSTNAME }, - 'pyanaconda/modules/storage/devicetree/fsset.py': { - 'mountpoint': 1, # format string specifier mount_point - }, 'pyanaconda/ui/gui/spokes/subscription.glade': { 'hostname': 1 # hostname:port placeholder for proxy URL entry } diff --git a/tests/unit_tests/pyanaconda_tests/modules/storage/test_fsset.py b/tests/unit_tests/pyanaconda_tests/modules/storage/test_fsset.py index 25794bbbd1e..057c7003d9f 100644 --- a/tests/unit_tests/pyanaconda_tests/modules/storage/test_fsset.py +++ b/tests/unit_tests/pyanaconda_tests/modules/storage/test_fsset.py @@ -247,6 +247,3 @@ def test_root_parse_fstab(self): self.assertEqual(mounts["/mnt/testmount"], test_dev) self.assertTrue(test_dev in devices) - - print("MYDEBUG: %s" % mounts) - print("MYDEBUG: %s" % devices)