From 6830f29dae14683c59b109cb8919b4bbadc3a59b Mon Sep 17 00:00:00 2001 From: Vojtech Trefny Date: Fri, 6 Sep 2024 10:05:16 +0200 Subject: [PATCH] Fix spelling issues found by codespell and spellintian --- blivet/blivet.py | 4 ++-- blivet/dbus/blivet.py | 4 ++-- blivet/devicelibs/crypto.py | 2 +- blivet/devicelibs/edd.py | 4 ++-- blivet/devicelibs/raid.py | 4 ++-- blivet/devices/lvm.py | 8 ++++---- blivet/devices/partition.py | 2 +- blivet/devices/storage.py | 2 +- blivet/devicetree.py | 2 +- blivet/events/manager.py | 2 +- blivet/formats/fs.py | 4 ++-- blivet/fstab.py | 2 +- blivet/iscsi.py | 2 +- blivet/partitioning.py | 10 +++++----- blivet/populator/helpers/lvm.py | 2 +- blivet/populator/populator.py | 2 +- blivet/tasks/fssync.py | 4 ++-- blivet/udev.py | 2 +- blivet/util.py | 8 ++++---- scripts/docs-update | 2 +- tests/run_tests.py | 2 +- tests/unit_tests/blivettestcase.py | 2 +- tests/unit_tests/size_test.py | 6 +++--- tests/vmtests/README.rst | 2 +- tests/vmtests/runvmtests.py | 4 ++-- 25 files changed, 44 insertions(+), 44 deletions(-) diff --git a/blivet/blivet.py b/blivet/blivet.py index b5f3703a8..b55717acd 100644 --- a/blivet/blivet.py +++ b/blivet/blivet.py @@ -75,7 +75,7 @@ def __init__(self): self.size_sets = [] self.set_default_fstype(get_default_filesystem_type()) - # fstab write location purposedly set to None. It has to be overridden + # fstab write location purposely set to None. It has to be overridden # manually when using blivet. if HAVE_LIBMOUNT: self.fstab = FSTabManager(src_file=FSTAB_PATH, dest_file=None) @@ -437,7 +437,7 @@ def get_free_space(self, disks=None, partitions=None): allocated to any partition. disks and partitions allow specifying a set of disks other than - self.disks and partition values other than self.parttions. + self.disks and partition values other than self.partitions. :keyword disks: overrides :attr:`disks` :type disks: list diff --git a/blivet/dbus/blivet.py b/blivet/dbus/blivet.py index 32b8c5f42..65adb707c 100644 --- a/blivet/dbus/blivet.py +++ b/blivet/dbus/blivet.py @@ -215,7 +215,7 @@ def Commit(self): self._blivet.do_it() except StorageError as e: raise dbus.exceptions.DBusException('%s.%s' % (BUS_NAME, e.__class__.__name__), - "An error occured while committing the " + "An error occurred while committing the " "changes to disk: %s" % str(e)) @dbus.service.method(dbus_interface=BLIVET_INTERFACE, in_signature='a{sv}', out_signature='o') @@ -236,7 +236,7 @@ def Factory(self, kwargs): device = self._blivet.factory_device(**kwargs) except StorageError as e: raise dbus.exceptions.DBusException('%s.%s' % (BUS_NAME, e.__class__.__name__), - "An error occured while configuring the " + "An error occurred while configuring the " "device: %s" % str(e)) if device is None: diff --git a/blivet/devicelibs/crypto.py b/blivet/devicelibs/crypto.py index a880972a5..5e31cbf51 100644 --- a/blivet/devicelibs/crypto.py +++ b/blivet/devicelibs/crypto.py @@ -58,7 +58,7 @@ def calculate_luks2_max_memory(): """ Calculates maximum RAM that will be used during LUKS format. - The calculation is based on currenly available (free) memory. + The calculation is based on currently available (free) memory. This value will be used for the 'max_memory_kb' option for the 'argon2' key derivation function. """ diff --git a/blivet/devicelibs/edd.py b/blivet/devicelibs/edd.py index 67b718650..9728db575 100644 --- a/blivet/devicelibs/edd.py +++ b/blivet/devicelibs/edd.py @@ -51,7 +51,7 @@ re_interface_edd3_sata = re.compile(r'^SATA\s*device: (\S*)\s*$') # EDD 4 features from 2010 and later. Awesomely, the "version" output from # int 13 AH=41h says: AH Version of extensions. Shall be set to 30h, -# so there's no way to distinguish these from EDD 3, even thuogh SATA does +# so there's no way to distinguish these from EDD 3, even though SATA does # differ. In theory, if we're on <4.0, pmp should always be all 0's. re_interface_edd4_sata = re.compile(r'^SATA\s*device: (\S*)\s*pmp: (\S*)\s*$') re_interface_sas = re.compile(r'^SAS\s*sas_address: (\S*)\s*lun: \(\S*\)\s*$') @@ -357,7 +357,7 @@ class EddMatcher(object): """ This object tries to match given entry to a disk device name. - Assuming, heuristic analysis and guessing hapens here. + Assuming, heuristic analysis and guessing happens here. """ def __init__(self, edd_entry, root=None): diff --git a/blivet/devicelibs/raid.py b/blivet/devicelibs/raid.py index 7a891c02a..fa61f915d 100644 --- a/blivet/devicelibs/raid.py +++ b/blivet/devicelibs/raid.py @@ -88,7 +88,7 @@ class RAIDn(RAIDLevel, metaclass=abc.ABCMeta): All methods in this class fall into these categories: - 1) May not be overrridden in any subclass. + 1) May not be overridden in any subclass. 2) Are private abstract methods. @@ -127,7 +127,7 @@ def get_max_spares(self, member_count): :param int member_count: the number of members belonging to the array :rtype: int - Raiess a RaidError if member_count is fewer than the minimum + Raises a RaidError if member_count is fewer than the minimum number of members required for this level. """ if member_count < self.min_members: diff --git a/blivet/devices/lvm.py b/blivet/devices/lvm.py index 661881ea9..506a855c3 100644 --- a/blivet/devices/lvm.py +++ b/blivet/devices/lvm.py @@ -1412,7 +1412,7 @@ def _add_to_parents(self): # meaning of 'parents') pass - # internal LVs follow different rules limitting size + # internal LVs follow different rules limiting size def _set_size(self, newsize): if not isinstance(newsize, Size): raise AttributeError("new size must of type Size") @@ -1428,7 +1428,7 @@ def _set_size(self, newsize): @property def max_size(self): - # no format, so maximum size is only limitted by either the parent LV or the VG + # no format, so maximum size is only limited by either the parent LV or the VG if not self.takes_extra_space: return self._parent_lv.max_size else: @@ -1926,7 +1926,7 @@ def _set_size(self, newsize): def _pre_create(self): # skip LVMLogicalVolumeDevice's _pre_create() method as it checks for a # free space in a VG which doesn't make sense for a ThinLV and causes a - # bug by limitting the ThinLV's size to VG free space which is nonsense + # bug by limiting the ThinLV's size to VG free space which is nonsense super(LVMLogicalVolumeBase, self)._pre_create() # pylint: disable=bad-super-call def _create(self): @@ -2195,7 +2195,7 @@ def _set_size(self, newsize): def _pre_create(self): # skip LVMLogicalVolumeDevice's _pre_create() method as it checks for a # free space in a VG which doesn't make sense for a VDO LV and causes a - # bug by limitting the VDO LV's size to VG free space which is nonsense + # bug by limiting the VDO LV's size to VG free space which is nonsense super(LVMLogicalVolumeBase, self)._pre_create() # pylint: disable=bad-super-call def _create(self): diff --git a/blivet/devices/partition.py b/blivet/devices/partition.py index eb97f3e79..4a9c96aeb 100644 --- a/blivet/devices/partition.py +++ b/blivet/devices/partition.py @@ -740,7 +740,7 @@ def _post_create(self): self.parted_partition = partition if not self.is_extended: # Ensure old metadata which lived in freespace so did not get - # explictly destroyed by a destroyformat action gets wiped + # explicitly destroyed by a destroyformat action gets wiped DeviceFormat(device=self.path, exists=True).destroy() StorageDevice._post_create(self) diff --git a/blivet/devices/storage.py b/blivet/devices/storage.py index 58cc1bdd6..5eed37e6d 100644 --- a/blivet/devices/storage.py +++ b/blivet/devices/storage.py @@ -398,7 +398,7 @@ def _rename(self, old_name, new_name, dry_run=False): # pylint: disable=unused- Note: This method should only be invoked via the ActionConfigureDevice.execute method. All the pre-conditions enforced by ActionConfigureDevice.__init__ are assumed to hold. - self.name value is chaged by the ActionConfigureDevice.apply method. + self.name value is changed by the ActionConfigureDevice.apply method. Caller must make sure the name is unique, this method cannot check the name uniqueness. diff --git a/blivet/devicetree.py b/blivet/devicetree.py index 5cac216b6..ddc94813e 100644 --- a/blivet/devicetree.py +++ b/blivet/devicetree.py @@ -868,7 +868,7 @@ def hide(self, device): been canceled. If a device does not exist then it must have been removed by the - cancelation of all the actions, so it does not need to be removed + cancellation of all the actions, so it does not need to be removed explicitly. Most devices are considered leaf devices if they have no children, diff --git a/blivet/events/manager.py b/blivet/events/manager.py index b47ceee82..35bd9e837 100644 --- a/blivet/events/manager.py +++ b/blivet/events/manager.py @@ -170,7 +170,7 @@ def notify_cb(self, cb): @property def error_cb(self): - """ callback to run when an exception occurrs in a thread. """ + """ callback to run when an exception occurs in a thread. """ return self._error_cb @error_cb.setter diff --git a/blivet/formats/fs.py b/blivet/formats/fs.py index 9f0525f1e..79fd56e45 100644 --- a/blivet/formats/fs.py +++ b/blivet/formats/fs.py @@ -90,7 +90,7 @@ class FS(DeviceFormat): _writelabel_class = fswritelabel.UnimplementedFSWriteLabel _writeuuid_class = fswriteuuid.UnimplementedFSWriteUUID _selinux_supported = True - # This constant is aquired by testing some filesystems + # This constant is acquired by testing some filesystems # and it's giving us percentage of space left after the format. # This number is more guess than precise number because this # value is already unpredictable and can change in the future... @@ -1124,7 +1124,7 @@ class GFS2(FS): _packages = ["gfs2-utils"] _mkfs_class = fsmkfs.GFS2Mkfs _labelfs = fslabeling.GFS2Labeling() - # FIXME parted needs to be thaught about btrfs so that we can set the + # FIXME parted needs to be taught about btrfs so that we can set the # partition table type correctly for btrfs partitions # parted_system = fileSystemType["gfs2"] diff --git a/blivet/fstab.py b/blivet/fstab.py index c83085794..653bb11c5 100644 --- a/blivet/fstab.py +++ b/blivet/fstab.py @@ -35,7 +35,7 @@ class FSTabOptions(object): - """ User prefered fstab settings object intended to be attached to device.format. + """ User preferred fstab settings object intended to be attached to device.format. Set variables override otherwise automatically obtained values put into fstab. """ diff --git a/blivet/iscsi.py b/blivet/iscsi.py index 95674665b..7885659ed 100644 --- a/blivet/iscsi.py +++ b/blivet/iscsi.py @@ -314,7 +314,7 @@ def _start_ibft(self): if not flags.ibft: return - # Make sure iscsi_ibft is loaded otherwise any atttempts will fail with + # Make sure iscsi_ibft is loaded otherwise any attempts will fail with # 'Could not get list of targets from firmware. (err 21)' try: BlockDev.utils.load_kernel_module("iscsi_ibft", None) diff --git a/blivet/partitioning.py b/blivet/partitioning.py index ec9918d41..421d5329b 100644 --- a/blivet/partitioning.py +++ b/blivet/partitioning.py @@ -351,7 +351,7 @@ def remove_new_partitions(disks, remove, all_partitions): def _remove_extended(disk, extended): """ We may want to remove extended partition from the disk too. This should happen if we don't have the PartitionDevice object - or in installer_mode after we've removed all logical paritions. + or in installer_mode after we've removed all logical partitions. """ if extended and not disk.format.logical_partitions: @@ -363,7 +363,7 @@ def _remove_extended(disk, extended): return False else: if any(l.disk == extended.disk for l in removed_logical): - # we removed all logical paritions from this extended + # we removed all logical partitions from this extended # so we no longer need this one return True else: @@ -675,7 +675,7 @@ def resolve_disk_tags(disks, tags): :param tags: tags to select disks based on :type tags: list of str - If tags contains multiple values it is interpeted as + If tags contains multiple values it is interpreted as "include disks containing *any* of these tags". """ return [disk for disk in disks if any(tag in disk.tags for tag in tags)] @@ -984,7 +984,7 @@ def allocate_partitions(storage, disks, partitions, freespace, boot_disk=None): log.debug("creating extended partition") ext = add_partition(disklabel, free, part_type, None) - # extedned partition took all free space - make the size request smaller + # extended partition took all free space - make the size request smaller if aligned_size > (ext.geometry.length - disklabel.alignment.grainSize) * disklabel.sector_size: log.debug("not enough free space after creating extended " "partition - shrinking the logical partition") @@ -1883,7 +1883,7 @@ def grow_partitions(disks, partitions, free, size_sets=None): log.debug("back from remove_new_partitions") # adjust the extended partition as needed - # we will ony resize an extended partition that we created + # we will only resize an extended partition that we created log.debug("extended: %s", extended_geometry) if extended_geometry and \ chunk.geometry.contains(extended_geometry): diff --git a/blivet/populator/helpers/lvm.py b/blivet/populator/helpers/lvm.py index 0cf47ba43..4ba51e4b8 100644 --- a/blivet/populator/helpers/lvm.py +++ b/blivet/populator/helpers/lvm.py @@ -346,7 +346,7 @@ def create_internal_lv(lv): # Instead of doing a topological sort on internal LVs to make sure the # parent LV is always created before its internal LVs (an internal LV # can have internal LVs), we just create all the instances here and - # assign their parents later. Those who are not assinged a parent (which + # assign their parents later. Those who are not assigned a parent (which # would hold a reference to them) will get eaten by the garbage # collector. diff --git a/blivet/populator/populator.py b/blivet/populator/populator.py index 2ddea6618..ad7b56fe0 100644 --- a/blivet/populator/populator.py +++ b/blivet/populator/populator.py @@ -72,7 +72,7 @@ def parted_exn_handler(exn_type, exn_options, exn_msg): class PopulatorMixin(object, metaclass=SynchronizedMeta): def __init__(self, disk_images=None): """ - :keyword disk_images: dictoinary of disk images + :keyword disk_images: dictionary of disk images :type list: dict """ luks_data.reset(passphrase=None, luks_dict={}) diff --git a/blivet/tasks/fssync.py b/blivet/tasks/fssync.py index 07d64c039..7142c2b90 100644 --- a/blivet/tasks/fssync.py +++ b/blivet/tasks/fssync.py @@ -71,12 +71,12 @@ def do_task(self, root="/"): try: BlockDev.fs.freeze(mountpoint) except BlockDev.FSError as e: - error_msg = "failed to sync filesytem: %s" % e + error_msg = "failed to sync filesystem: %s" % e try: BlockDev.fs.unfreeze(mountpoint) except BlockDev.FSError as e: - error_msg = "failed to sync filesytem: %s" % e + error_msg = "failed to sync filesystem: %s" % e if error_msg: raise FSError(error_msg) diff --git a/blivet/udev.py b/blivet/udev.py index 667e1f3c9..73a79d418 100644 --- a/blivet/udev.py +++ b/blivet/udev.py @@ -878,7 +878,7 @@ def device_get_iscsi_name(info): path_components = device_get_path(info).split("-") - # Tricky, the name itself contains atleast 1 - char + # Tricky, the name itself contains at least 1 - char return "-".join(path_components[name_field:len(path_components) - 2]) diff --git a/blivet/util.py b/blivet/util.py index 4809084b5..d194a5bba 100644 --- a/blivet/util.py +++ b/blivet/util.py @@ -345,7 +345,7 @@ def total_memory(): def available_memory(): - """ Return the amount of system RAM that is currenly available. + """ Return the amount of system RAM that is currently available. :rtype: :class:`~.size.Size` """ @@ -373,7 +373,7 @@ def available_memory(): def normalize_path_slashes(path): """ Normalize the slashes in a filesystem path. - Does not actually examine the filesystme in any way. + Does not actually examine the filesystem in any way. """ while "//" in path: path = path.replace("//", "/") @@ -381,7 +381,7 @@ def normalize_path_slashes(path): def join_paths(*paths): - """ Joins filesystem paths without any consiration of slashes or + """ Joins filesystem paths without any consideration of slashes or whatnot and then normalizes repeated slashes. """ if len(paths) == 1 and hasattr(paths[0], "__iter__"): @@ -811,7 +811,7 @@ def variable_copy(obj, memo, omit=None, shallow=None, duplicate=None): :param duplicate: a list of names of attributes to duplicate :type duplicate: iterable of str - Note that all atrributes in duplicate must implement a duplicate() + Note that all attributes in duplicate must implement a duplicate() method that does what is expected of it. Attributes with type pyparted.Disk are known to do so. diff --git a/scripts/docs-update b/scripts/docs-update index 6a86537eb..67bda22ec 100755 --- a/scripts/docs-update +++ b/scripts/docs-update @@ -71,7 +71,7 @@ def main(blivet_branch): if ret != 0: print('Failed to show committed changes:\n%s' % out) return - print("Commited changes:\n%s" % out) + print("Committed changes:\n%s" % out) answer = input("Is this okay? [y/N]") if answer in ("y", "Y"): diff --git a/tests/run_tests.py b/tests/run_tests.py index 22d785c64..1d2561814 100644 --- a/tests/run_tests.py +++ b/tests/run_tests.py @@ -124,7 +124,7 @@ def get_version(): def _should_skip(distro=None, version=None, arch=None, reason=None): # pylint: disable=unused-argument - # all these can be lists or a single value, so covert everything to list + # all these can be lists or a single value, so convert everything to list if distro is not None and type(distro) is not list: distro = [distro] if version is not None and type(version) is not list: diff --git a/tests/unit_tests/blivettestcase.py b/tests/unit_tests/blivettestcase.py index 80b17efaf..4bc5e289c 100644 --- a/tests/unit_tests/blivettestcase.py +++ b/tests/unit_tests/blivettestcase.py @@ -99,7 +99,7 @@ def new_device(self, *args, **kwargs): device_class = kwargs.pop("device_class") # we intentionally don't pass the "exists" kwarg to the constructor - # becauses this causes issues with some devices (especially partitions) + # because this causes issues with some devices (especially partitions) # but we still need it for some LVs like VDO because we can't create # those so we need to fake their existence even for the constructor if device_class is blivet.devices.LVMLogicalVolumeDevice: diff --git a/tests/unit_tests/size_test.py b/tests/unit_tests/size_test.py index 6fc3fa81f..f95b37806 100644 --- a/tests/unit_tests/size_test.py +++ b/tests/unit_tests/size_test.py @@ -59,7 +59,7 @@ def test_human_readable(self): s = Size(478360371) self.assertEqual(s.human_readable(), "456.2 MiB") - # human_reable output should be the same as input for big enough sizes + # human_readable output should be the same as input for big enough sizes # and enough places and integer values s = Size("12.68 TiB") self.assertEqual(s.human_readable(max_places=2), "12.68 TiB") @@ -68,7 +68,7 @@ def test_human_readable(self): s = Size("300 MiB") self.assertEqual(s.human_readable(max_places=2), "300 MiB") - # rounding should work with max_places limitted + # rounding should work with max_places limited s = Size("12.687 TiB") self.assertEqual(s.human_readable(max_places=2), "12.69 TiB") s = Size("23.7874 TiB") @@ -334,7 +334,7 @@ class UtilityMethodsTestCase(unittest.TestCase): def test_arithmetic(self): s = Size("2GiB") - # Make sure arithmatic operations with Size always result in the expected type + # Make sure arithmetic operations with Size always result in the expected type self.assertIsInstance(s + s, Size) self.assertIsInstance(s - s, Size) self.assertIsInstance(s / s, Decimal) diff --git a/tests/vmtests/README.rst b/tests/vmtests/README.rst index bdbb534df..27b4ee52a 100644 --- a/tests/vmtests/README.rst +++ b/tests/vmtests/README.rst @@ -1,7 +1,7 @@ Running VM tests ================ -The VM tests are intended to run aginst a libvirt managed KVM +The VM tests are intended to run against a libvirt managed KVM virtual machine, running a Live OS with two unprovisioned disks present. A suitable environment can be created using the virt-install program and Fedora Workstation Live CD diff --git a/tests/vmtests/runvmtests.py b/tests/vmtests/runvmtests.py index 78f29171a..124350156 100755 --- a/tests/vmtests/runvmtests.py +++ b/tests/vmtests/runvmtests.py @@ -31,7 +31,7 @@ def parse_args(): parser.add_argument("--branch", type=str, help="Git branch to test", required=True) parser.add_argument("--connection", type=str, help="Libvirt connection URI", required=True) parser.add_argument("--name", type=str, help="Name of the virtual machine", required=True) - parser.add_argument("--ip", type=str, help="IP adress of the virtual machine", required=True) + parser.add_argument("--ip", type=str, help="IP address of the virtual machine", required=True) parser.add_argument("--vmpass", type=str, help="Root passphrase for the virtual machine", required=False) parser.add_argument("--virtpass", type=str, help="Root passphrase for the libvirt host", required=False) parser.add_argument("--verbose", "-v", action='store_true', help="Display verbose information") @@ -159,7 +159,7 @@ def run_tests(cmd_args): # switch to selected branch _stdin, stdout, stderr = ssh.exec_command("cd blivet && git checkout %s" % cmd_args.branch) if stdout.channel.recv_exit_status() != 0: - raise RuntimeError("Failed to switch to brach %s.\nOutput:\n%s\n%s" % + raise RuntimeError("Failed to switch to branch %s.\nOutput:\n%s\n%s" % (cmd_args.branch, stdout.read().decode("utf-8"), stderr.read().decode("utf-8")))