From 7402822f0bcc810eda6a2a55a9cc8fe778318557 Mon Sep 17 00:00:00 2001 From: Sean Mooney Date: Tue, 3 Oct 2023 00:51:35 +0100 Subject: [PATCH] [codespell] start fixing all the typos this is the inital patch of applying codespell to nova. codespell is a programing focused spellchecker that looks for common typos and corrects them. i am breaking this into multiple commits to make it simpler to read and will automate the execution of codespell at the end of the series. Change-Id: If24a6c0a890f713545faa2d44b069c352655274e --- HACKING.rst | 2 +- doc/dictionary.txt | 8 ++++++++ doc/source/configuration/policy-concepts.rst | 2 +- nova/api/openstack/compute/servers.py | 6 +++--- nova/api/validation/extra_specs/hw.py | 2 +- nova/conductor/tasks/migrate.py | 4 ++-- nova/conf/scheduler.py | 14 +++++++------- nova/db/main/api.py | 2 +- nova/pci/manager.py | 4 ++-- nova/policies/servers.py | 2 +- nova/policy.py | 4 ++-- nova/scheduler/weights/metrics.py | 2 +- nova/service.py | 6 +++--- nova/tests/functional/db/test_virtual_interface.py | 2 +- nova/virt/hyperv/vmops.py | 2 +- nova/virt/libvirt/machine_type_utils.py | 2 +- nova/virt/libvirt/utils.py | 2 +- ...t_bus-image-metadata-prop-059bea459dec618e.yaml | 2 +- ...p-ironic-boot-from-volume-cfb98c733cf09a92.yaml | 2 +- .../notes/cpu-resources-d4e6a0c12681fa87.yaml | 2 +- .../releasenotes/notes/bochs-ffaa289da97d08c8.yaml | 2 +- ...ult-cputune-shares-values-85d5ddf4b8e24eaa.yaml | 2 +- .../notes/stable_rescue_bfv-cd0e9f0f7e9eaa25.yaml | 2 +- releasenotes/source/newton.rst | 2 +- setup.cfg | 5 +++++ 25 files changed, 49 insertions(+), 36 deletions(-) create mode 100644 doc/dictionary.txt diff --git a/HACKING.rst b/HACKING.rst index c5a1ba4ae39c..49bda8500597 100644 --- a/HACKING.rst +++ b/HACKING.rst @@ -63,7 +63,7 @@ Nova Specific Commandments assertNotRegexpMatches - [N362] Imports for privsep modules should be specific. Use "import nova.privsep.path", not "from nova.privsep import path". This ensures callers know that the method they're - calling is using priviledge escalation. + calling is using privilege escalation. - [N363] Disallow ``(not_a_tuple)`` because you meant ``(a_tuple_of_one,)``. - [N364] Check non-existent mock assertion methods and attributes. - [N365] Check misuse of assertTrue/assertIsNone. diff --git a/doc/dictionary.txt b/doc/dictionary.txt new file mode 100644 index 000000000000..1ba71ab5dc92 --- /dev/null +++ b/doc/dictionary.txt @@ -0,0 +1,8 @@ +ot +hda +ser +ned +deques +affinitized +noes +Wile diff --git a/doc/source/configuration/policy-concepts.rst b/doc/source/configuration/policy-concepts.rst index 383b27247fac..3908138ecffa 100644 --- a/doc/source/configuration/policy-concepts.rst +++ b/doc/source/configuration/policy-concepts.rst @@ -254,7 +254,7 @@ overridden in the policy.yaml file but scope is not override-able. #. PROJECT_READER: ``reader`` role on ``project`` scope. This is used to perform read-only operation within project. For example: Get server. -#. PROJECT_MEMBER_OR_ADMIN: ``admin`` or ``member`` role on ``project`` scope. Such policy rules are default to most of the owner level APIs and aling +#. PROJECT_MEMBER_OR_ADMIN: ``admin`` or ``member`` role on ``project`` scope. Such policy rules are default to most of the owner level APIs and align with `member` role legacy admin can continue to access those APIs. #. PROJECT_READER_OR_ADMIN: ``admin`` or ``reader`` role on ``project`` scope. Such policy rules are default to most of the read only APIs so that legacy diff --git a/nova/api/openstack/compute/servers.py b/nova/api/openstack/compute/servers.py index 24adc2fa3b51..3ac06fcbfc85 100644 --- a/nova/api/openstack/compute/servers.py +++ b/nova/api/openstack/compute/servers.py @@ -487,7 +487,7 @@ class ServersController(wsgi.Controller): :param target: The target dict for ``context.can`` policy checks :param server_dict: The POST /servers request body "server" entry :param create_kwargs: dict that gets populated by this method and - passed to nova.comptue.api.API.create() + passed to nova.compute.api.API.create() :raises: webob.exc.HTTPBadRequest if the request parameters are invalid :raises: nova.exception.Forbidden if a policy check fails """ @@ -538,7 +538,7 @@ class ServersController(wsgi.Controller): :param target: The target dict for ``context.can`` policy checks :param server_dict: The POST /servers request body "server" entry :param create_kwargs: dict that gets populated by this method and - passed to nova.comptue.api.API.create() + passed to nova.compute.api.API.create() :raises: webob.exc.HTTPBadRequest if the request parameters are invalid :raises: nova.exception.Forbidden if a policy check fails """ @@ -644,7 +644,7 @@ class ServersController(wsgi.Controller): :param target: The target dict for ``context.can`` policy checks :param server_dict: The POST /servers request body "server" entry :param create_kwargs: dict that gets populated by this method and - passed to nova.comptue.api.API.create() + passed to nova.compute.api.API.create() :param host: Forced host of availability_zone :param node: Forced node of availability_zone :raise: webob.exc.HTTPBadRequest if the request parameters are invalid diff --git a/nova/api/validation/extra_specs/hw.py b/nova/api/validation/extra_specs/hw.py index c0c8f02809ed..3167d927c9d7 100644 --- a/nova/api/validation/extra_specs/hw.py +++ b/nova/api/validation/extra_specs/hw.py @@ -167,7 +167,7 @@ hugepage_validators = [ name='hw:locked_memory', description=( 'Determine if **guest** (instance) memory should be locked ' - 'preventing swaping. This is required in rare cases for device ' + 'preventing swapping. This is required in rare cases for device ' 'DMA transfers. Only supported by the libvirt virt driver.' ), value={ diff --git a/nova/conductor/tasks/migrate.py b/nova/conductor/tasks/migrate.py index 754f9e5ba7de..d77086178121 100644 --- a/nova/conductor/tasks/migrate.py +++ b/nova/conductor/tasks/migrate.py @@ -34,11 +34,11 @@ def replace_allocation_with_migration(context, instance, migration): :raises: ConsumerAllocationRetrievalFailed if reading the current allocation from placement fails :raises: ComputeHostNotFound if the host of the instance is not found in - the databse + the database :raises: AllocationMoveFailed if moving the allocation from the instance.uuid to the migration.uuid fails due to parallel placement operation on the instance consumer - :raises: NoValidHost if placement rejectes the update for other reasons + :raises: NoValidHost if placement rejects the update for other reasons (e.g. not enough resources) :returns: (source_compute_node, migration_allocation) """ diff --git a/nova/conf/scheduler.py b/nova/conf/scheduler.py index 6bb5da939bfb..87a39fb23e78 100644 --- a/nova/conf/scheduler.py +++ b/nova/conf/scheduler.py @@ -367,7 +367,7 @@ Possible values: cfg.FloatOpt("ram_weight_multiplier", default=1.0, help=""" -RAM weight multipler ratio. +RAM weight multiplier ratio. This option determines how hosts with more or less available RAM are weighed. A positive value will result in the scheduler preferring hosts with more @@ -383,7 +383,7 @@ enabled. Possible values: -* An integer or float value, where the value corresponds to the multipler +* An integer or float value, where the value corresponds to the multiplier ratio for this weigher. Related options: @@ -403,7 +403,7 @@ enabled. Possible values: -* An integer or float value, where the value corresponds to the multipler +* An integer or float value, where the value corresponds to the multiplier ratio for this weigher. Related options: @@ -413,7 +413,7 @@ Related options: cfg.FloatOpt("disk_weight_multiplier", default=1.0, help=""" -Disk weight multipler ratio. +Disk weight multiplier ratio. Multiplier used for weighing free disk space. Negative numbers mean to stack vs spread. @@ -423,7 +423,7 @@ is enabled. Possible values: -* An integer or float value, where the value corresponds to the multipler +* An integer or float value, where the value corresponds to the multiplier ratio for this weigher. """), cfg.FloatOpt("hypervisor_version_weight_multiplier", @@ -517,7 +517,7 @@ Related options: cfg.FloatOpt("io_ops_weight_multiplier", default=-1.0, help=""" -IO operations weight multipler ratio. +IO operations weight multiplier ratio. This option determines how hosts with differing workloads are weighed. Negative values, such as the default, will result in the scheduler preferring hosts with @@ -533,7 +533,7 @@ is enabled. Possible values: -* An integer or float value, where the value corresponds to the multipler +* An integer or float value, where the value corresponds to the multiplier ratio for this weigher. Related options: diff --git a/nova/db/main/api.py b/nova/db/main/api.py index f2a057723205..11d2b96caa9c 100644 --- a/nova/db/main/api.py +++ b/nova/db/main/api.py @@ -4349,7 +4349,7 @@ def _archive_deleted_rows_for_table( shadow table. Will also follow FK constraints and archive all referring rows. - Example: archving a record from the 'instances' table will also archive + Example: archiving a record from the 'instances' table will also archive the 'instance_extra' record before archiving the 'instances' record. :returns: 3-item tuple: diff --git a/nova/pci/manager.py b/nova/pci/manager.py index af6d72521b07..304b4fa22058 100644 --- a/nova/pci/manager.py +++ b/nova/pci/manager.py @@ -137,7 +137,7 @@ class PciDevTracker(object): # The raised exception is misleading as the problem is not with # the whitelist config but with the host PCI device reported by # libvirt. The code that matches the host PCI device to the - # withelist spec reuses the WhitelistPciAddress object to parse + # whitelist spec reuses the WhitelistPciAddress object to parse # the host PCI device address. That parsing can fail if the # PCI address has a 32 bit domain. But this should not prevent # processing the rest of the devices. So we simply skip this @@ -145,7 +145,7 @@ class PciDevTracker(object): # Please note that this except block does not ignore the # invalid whitelist configuration. The whitelist config has # already been parsed or rejected in case it was invalid. At - # this point the self.dev_filter representes the parsed and + # this point the self.dev_filter represents the parsed and # validated whitelist config. LOG.debug( 'Skipping PCI device %s reported by the hypervisor: %s', diff --git a/nova/policies/servers.py b/nova/policies/servers.py index 1e41baa203a8..15256415f230 100644 --- a/nova/policies/servers.py +++ b/nova/policies/servers.py @@ -29,7 +29,7 @@ DEPRECATED_POLICY = policy.DeprecatedRule( DEPRECATED_REASON = """ Policies for showing flavor extra specs in server APIs response is -seprated as new policy. This policy is deprecated only for that but +separated as new policy. This policy is deprecated only for that but not for list extra specs and showing it in flavor API response. """ diff --git a/nova/policy.py b/nova/policy.py index c66489cc8d20..2f7111aea0a1 100644 --- a/nova/policy.py +++ b/nova/policy.py @@ -84,7 +84,7 @@ def init(policy_file=None, rules=None, default_rule=None, use_conf=True, rules=rules, default_rule=default_rule, use_conf=use_conf) - # NOTE(gmann): Explictly disable the warnings for policies + # NOTE(gmann): Explicitly disable the warnings for policies # changing their default check_str. During policy-defaults-refresh # work, all the policy defaults have been changed and warning for # each policy started filling the logs limit for various tool. @@ -181,7 +181,7 @@ def authorize(context, action, target=None, do_raise=True, exc=None): if not exc: exc = exception.PolicyNotAuthorized - # Legacy fallback for emtpy target from context.can() + # Legacy fallback for empty target from context.can() # should be removed once we improve testing and scope checks if target is None: target = default_target(context) diff --git a/nova/scheduler/weights/metrics.py b/nova/scheduler/weights/metrics.py index a4a9afca225a..a731e4bb20a6 100644 --- a/nova/scheduler/weights/metrics.py +++ b/nova/scheduler/weights/metrics.py @@ -18,7 +18,7 @@ Metrics Weigher. Weigh hosts by their metrics. This weigher can compute the weight based on the compute node host's various metrics. The to-be weighed metrics and their weighing ratio are specified -in the configuration file as the followings: +in the configuration file as follows: [metrics] weight_setting = name1=1.0, name2=-1.0 diff --git a/nova/service.py b/nova/service.py index ddc6ec156615..a4dc6293d6b9 100644 --- a/nova/service.py +++ b/nova/service.py @@ -148,7 +148,7 @@ class Service(service.Service): # See https://bugs.python.org/issue6721 for more information. # With python 3.7, it would be possible for oslo.db to make use of the # os.register_at_fork() method to reinitialize its lock. Until we - # require python 3.7 as a mininum version, we must handle the situation + # require python 3.7 as a minimum version, we must handle the situation # outside of oslo.db. context.CELL_CACHE = {} @@ -424,7 +424,7 @@ class WSGIService(service.Service): # See https://bugs.python.org/issue6721 for more information. # With python 3.7, it would be possible for oslo.db to make use of the # os.register_at_fork() method to reinitialize its lock. Until we - # require python 3.7 as a mininum version, we must handle the situation + # require python 3.7 as a minimum version, we must handle the situation # outside of oslo.db. context.CELL_CACHE = {} @@ -438,7 +438,7 @@ class WSGIService(service.Service): service_ref = _create_service_ref(self, ctxt) except (exception.ServiceTopicExists, exception.ServiceBinaryExists): - # NOTE(danms): If we race to create a record wth a sibling, + # NOTE(danms): If we race to create a record with a sibling, # don't fail here. service_ref = objects.Service.get_by_host_and_binary( ctxt, self.host, self.binary) diff --git a/nova/tests/functional/db/test_virtual_interface.py b/nova/tests/functional/db/test_virtual_interface.py index 2accb80c01ed..fc9f9ecc1a62 100644 --- a/nova/tests/functional/db/test_virtual_interface.py +++ b/nova/tests/functional/db/test_virtual_interface.py @@ -236,7 +236,7 @@ class VirtualInterfaceListMigrationTestCase( match, done = virtual_interface.fill_virtual_interface_list( self.context, 5) - # I don't know whats going on so instance VirtualInterfaceList + # I don't know what's going on so instance VirtualInterfaceList # should stay untouched. self.assertEqual(1, match) self.assertEqual(0, done) diff --git a/nova/virt/hyperv/vmops.py b/nova/virt/hyperv/vmops.py index 08adeada7612..7a6695b6eff0 100644 --- a/nova/virt/hyperv/vmops.py +++ b/nova/virt/hyperv/vmops.py @@ -477,7 +477,7 @@ class VMOps(object): reason=_("Hyper-V does not support CPU pinning."), instance_id=instance.uuid) - # validate that the requested NUMA topology is not asymetric. + # validate that the requested NUMA topology is not asymmetric. # e.g.: it should be like: (X cpus, X cpus, Y cpus), where X == Y. # same with memory. for cell in instance_topology.cells: diff --git a/nova/virt/libvirt/machine_type_utils.py b/nova/virt/libvirt/machine_type_utils.py index b05427e59bfa..a359498dd596 100644 --- a/nova/virt/libvirt/machine_type_utils.py +++ b/nova/virt/libvirt/machine_type_utils.py @@ -90,7 +90,7 @@ def _check_update_to_existing_type( ) -> None: """Check the update to an existing machine type - The aim here is to block operators from moving between the underying + The aim here is to block operators from moving between the underlying machine types, between versioned and aliased types or to an older version of the same type during an update. diff --git a/nova/virt/libvirt/utils.py b/nova/virt/libvirt/utils.py index e1298ee5c894..cda7a200a290 100644 --- a/nova/virt/libvirt/utils.py +++ b/nova/virt/libvirt/utils.py @@ -634,7 +634,7 @@ def mdev_name2uuid(mdev_name: str) -> str: :returns: string containing the uuid """ mdev_uuid = mdev_name[5:].replace('_', '-') - # Unconditionnally remove the PCI address from the name + # Unconditionally remove the PCI address from the name mdev_uuid = mdev_uuid[:36] return str(uuid.UUID(mdev_uuid)) diff --git a/releasenotes/notes/add-hw_input_bus-image-metadata-prop-059bea459dec618e.yaml b/releasenotes/notes/add-hw_input_bus-image-metadata-prop-059bea459dec618e.yaml index d06499abb8c9..cb772eb88fa7 100644 --- a/releasenotes/notes/add-hw_input_bus-image-metadata-prop-059bea459dec618e.yaml +++ b/releasenotes/notes/add-hw_input_bus-image-metadata-prop-059bea459dec618e.yaml @@ -7,4 +7,4 @@ features: on compute nodes using the libvirt virt driver. Two values are currently accepted: ``usb`` and ``virtio``. This image metadata property effectively replaced the ``hw_pointer_model`` image metadata property, which is - nontheless retained for backwards compatibility purposes. + nonetheless retained for backwards compatibility purposes. diff --git a/releasenotes/notes/bp-ironic-boot-from-volume-cfb98c733cf09a92.yaml b/releasenotes/notes/bp-ironic-boot-from-volume-cfb98c733cf09a92.yaml index 539da2720b4d..54f41351d855 100644 --- a/releasenotes/notes/bp-ironic-boot-from-volume-cfb98c733cf09a92.yaml +++ b/releasenotes/notes/bp-ironic-boot-from-volume-cfb98c733cf09a92.yaml @@ -9,4 +9,4 @@ upgrade: - | The required ironic API version is updated to 1.32. The ironic service must be upgraded to an ironic release > 8.0 before nova is upgraded, - otherwise all ironic intergration will fail. + otherwise all ironic integration will fail. diff --git a/releasenotes/notes/cpu-resources-d4e6a0c12681fa87.yaml b/releasenotes/notes/cpu-resources-d4e6a0c12681fa87.yaml index e8bb221e12f7..d74b4cf08fb5 100644 --- a/releasenotes/notes/cpu-resources-d4e6a0c12681fa87.yaml +++ b/releasenotes/notes/cpu-resources-d4e6a0c12681fa87.yaml @@ -25,7 +25,7 @@ features: The ``[compute] cpu_shared_set`` configuration option will now be used to configure the host CPUs that should be used for ``VCPU`` inventory, replacing the deprecated ``vcpu_pin_set`` option. Refer to the help text of - the ``[compute] cpu_shared_set`` config option for more infomration. + the ``[compute] cpu_shared_set`` config option for more information. - | A new configuration option, ``[workarounds] disable_fallback_pcpu_query``, has been added. When creating or moving pinned instances, the scheduler will diff --git a/releasenotes/notes/releasenotes/notes/bochs-ffaa289da97d08c8.yaml b/releasenotes/notes/releasenotes/notes/bochs-ffaa289da97d08c8.yaml index 4b5e310c8d15..4ac5003b4452 100644 --- a/releasenotes/notes/releasenotes/notes/bochs-ffaa289da97d08c8.yaml +++ b/releasenotes/notes/releasenotes/notes/bochs-ffaa289da97d08c8.yaml @@ -4,4 +4,4 @@ features: Add support for the ``bochs`` libvirt video model. This is a legacy-free video model that is best suited for UEFI guests. In limited cases (e.g. if the guest does not depend on direct VGA - hardware access), it can be useable for BIOS guests as well. + hardware access), it can be usable for BIOS guests as well. diff --git a/releasenotes/notes/remove-default-cputune-shares-values-85d5ddf4b8e24eaa.yaml b/releasenotes/notes/remove-default-cputune-shares-values-85d5ddf4b8e24eaa.yaml index 9dd0987bb8c1..e0f8ebc7c1c2 100644 --- a/releasenotes/notes/remove-default-cputune-shares-values-85d5ddf4b8e24eaa.yaml +++ b/releasenotes/notes/remove-default-cputune-shares-values-85d5ddf4b8e24eaa.yaml @@ -2,7 +2,7 @@ upgrade: - | In the libvirt driver, the default value of the ```` element has been removed, and is now left to libvirt to decide. This is - because allowed values are platform dependant, and the previous code was + because allowed values are platform dependent, and the previous code was not guaranteed to be supported on all platforms. If any of your flavors are using the quota:cpu_shares extra spec, you may need to resize to a supported value before upgrading. diff --git a/releasenotes/notes/stable_rescue_bfv-cd0e9f0f7e9eaa25.yaml b/releasenotes/notes/stable_rescue_bfv-cd0e9f0f7e9eaa25.yaml index 80aefaa2c0db..97b43ccc342d 100644 --- a/releasenotes/notes/stable_rescue_bfv-cd0e9f0f7e9eaa25.yaml +++ b/releasenotes/notes/stable_rescue_bfv-cd0e9f0f7e9eaa25.yaml @@ -6,5 +6,5 @@ features: instance also reports the ``COMPUTE_RESCUE_BFV`` trait such as the libvirt driver. - No changes have been made to the request or reponse parameters of the + No changes have been made to the request or response parameters of the rescue API itself. diff --git a/releasenotes/source/newton.rst b/releasenotes/source/newton.rst index 284a6800920f..b2d914a2e7c3 100644 --- a/releasenotes/source/newton.rst +++ b/releasenotes/source/newton.rst @@ -760,7 +760,7 @@ Upgrade Notes ``/opt/stack/data/nova/instances/34198248-5541-4d52-a0b4-a6635a7802dd/``. In Newton backward compatibility is dropped. For instances that haven't - been restarted since Folsom and earlier maintanance should be scheduled + been restarted since Folsom and earlier maintenance should be scheduled before upgrade(stop, rename directory to instance.uuid, then start) so Nova will start using new paths for instances. diff --git a/setup.cfg b/setup.cfg index fa6f6af656dd..ca02b12ddc65 100644 --- a/setup.cfg +++ b/setup.cfg @@ -101,3 +101,8 @@ follow_imports = skip incremental = true check_untyped_defs = true warn_unused_ignores = true + +[codespell] +skip = *.po,*.js,*.css,*.html,*.svg,HACKING.py,./doc/build*,*_static*,doc/dictionary.txt +count = +quiet-level = 4 \ No newline at end of file