Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix spelling issues found by codespell and spellintian #1285

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions blivet/blivet.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions blivet/dbus/blivet.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand All @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion blivet/devicelibs/crypto.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
"""
Expand Down
4 changes: 2 additions & 2 deletions blivet/devicelibs/edd.py
Original file line number Diff line number Diff line change
Expand Up @@ -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*$')
Expand Down Expand Up @@ -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):
Expand Down
4 changes: 2 additions & 2 deletions blivet/devicelibs/raid.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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:
Expand Down
8 changes: 4 additions & 4 deletions blivet/devices/lvm.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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:
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion blivet/devices/partition.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion blivet/devices/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion blivet/devicetree.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion blivet/events/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions blivet/formats/fs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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...
Expand Down Expand Up @@ -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"]

Expand Down
2 changes: 1 addition & 1 deletion blivet/fstab.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
"""

Expand Down
2 changes: 1 addition & 1 deletion blivet/iscsi.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
10 changes: 5 additions & 5 deletions blivet/partitioning.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down Expand Up @@ -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)]
Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion blivet/populator/helpers/lvm.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion blivet/populator/populator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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={})
Expand Down
4 changes: 2 additions & 2 deletions blivet/tasks/fssync.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion blivet/udev.py
Original file line number Diff line number Diff line change
Expand Up @@ -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])


Expand Down
8 changes: 4 additions & 4 deletions blivet/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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`
"""
Expand Down Expand Up @@ -373,15 +373,15 @@ 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("//", "/")
return 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__"):
Expand Down Expand Up @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion scripts/docs-update
Original file line number Diff line number Diff line change
Expand Up @@ -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"):
Expand Down
2 changes: 1 addition & 1 deletion tests/run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion tests/unit_tests/blivettestcase.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 3 additions & 3 deletions tests/unit_tests/size_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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")
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion tests/vmtests/README.rst
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions tests/vmtests/runvmtests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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")))

Expand Down