Skip to content
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
2 changes: 1 addition & 1 deletion cloudinit/config/cc_chef.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ def install_chef(cloud: Cloud, chef_cfg):
)
install_chef_from_gems(ruby_version, chef_version, cloud.distro)
# Retain backwards compat, by preferring True instead of False
# when not provided/overriden...
# when not provided/overridden...
run = util.get_cfg_option_bool(chef_cfg, "exec", default=True)
elif install_type == "packages":
# This will install and run the chef-client from packages
Expand Down
2 changes: 1 addition & 1 deletion cloudinit/config/cc_phone_home.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def handle(name: str, cfg: Config, cloud: Cloud, args: list) -> None:
else:
real_submit_keys[k] = str(v)

# Incase the url is parameterized
# In case the url is parameterized
url_params = {
"INSTANCE_ID": all_keys["instance_id"],
}
Expand Down
2 changes: 1 addition & 1 deletion cloudinit/config/cc_ssh.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def set_redhat_keyfile_perms(keyfile: str) -> None:
- 'ssh_keys' group is present and owns the private keys.
- private keys have permission 0o640.
For fedora 38, centos 10 stream and above:
- ssh version is atleast version 9.
- ssh version is at least version 9.
- 'ssh_keys' group is absent. 'root' group owns the keys.
- private keys have permission 0o600, same as upstream.
Public keys in all cases have permission 0o644.
Expand Down
2 changes: 1 addition & 1 deletion cloudinit/config/cc_ssh_import_id.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def import_ssh_ids(ids, user):
except KeyError as exc:
raise exc

# TODO: We have a use case that involes setting a proxy value earlier
# TODO: We have a use case that involves setting a proxy value earlier
# in boot and the user wants this env used when using ssh-import-id.
# E.g.,:
# bootcmd:
Expand Down
2 changes: 1 addition & 1 deletion cloudinit/config/cc_yum_add_repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def handle(name: str, cfg: Config, cloud: Cloud, args: list) -> None:

if missing_required == len(req_fields):
LOG.warning(
"Repository %s should contain atleast one of the"
"Repository %s should contain at least one of the"
" following configuration entries: %s, skipping!",
repo_id,
", ".join(req_fields),
Expand Down
2 changes: 1 addition & 1 deletion cloudinit/config/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ def format_message(key: str):
if annotate:
return f" {msg}"

# italicised RST - no whitespace between astrisk and text
# italicised RST - no whitespace between asterisk and text
return f"\n\n*{msg.strip()}*"

# define print order
Expand Down
2 changes: 1 addition & 1 deletion cloudinit/distros/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ def update_hostname(self, hostname, fqdn, prev_hostname_fn):
)
return

# Remove duplicates (incase the previous config filename)
# Remove duplicates (in case the previous config filename)
# is the same as the system config filename, don't bother
# doing it twice
update_files = set([f for f in update_files if f])
Expand Down
2 changes: 1 addition & 1 deletion cloudinit/mergers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def _handle_unknown(self, _meth_wanted, value, _merge_with):
# object and a object to merge_with.
#
# If not found the merge will be given to a '_handle_unknown'
# function which can decide what to do wit the 2 values.
# function which can decide what to do with the 2 values.
def merge(self, source, merge_with):
type_name = type_utils.obj_name(source)
type_name = type_name.lower()
Expand Down
2 changes: 1 addition & 1 deletion cloudinit/sources/helpers/netlink.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def read_netlink_socket(netlink_socket, timeout=None):
"""
assert netlink_socket is not None, "netlink socket is none"
read_set, _, _ = select.select([netlink_socket], [], [], timeout)
# Incase of timeout,read_set doesn't contain netlink socket.
# In case of timeout,read_set doesn't contain netlink socket.
# just return from this function
if netlink_socket not in read_set:
return None
Expand Down
2 changes: 1 addition & 1 deletion cloudinit/stages.py
Original file line number Diff line number Diff line change
Expand Up @@ -956,7 +956,7 @@ def _consume_userdata(self, frequency=PER_INSTANCE):
Consume the userdata and run the part handlers
"""

# Ensure datasource fetched before activation (just incase)
# Ensure datasource fetched before activation (just in case)
user_data_msg = self.datasource.get_userdata(True)

# This keeps track of all the active handlers
Expand Down
2 changes: 1 addition & 1 deletion cloudinit/user_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ def is_skippable(part):
return False


# Coverts a raw string into a mime message
# Converts a raw string into a mime message
def convert_string(raw_data, content_type=NOT_MULTIPART_TYPE):
"""convert a string (more likely bytes) or a message into
a mime message."""
Expand Down
6 changes: 3 additions & 3 deletions cloudinit/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -995,7 +995,7 @@ def load_yaml(blob, default=None, allowed=(dict,)):
LOG.debug("loaded blob returned None, returning default.")
converted = default
elif not isinstance(converted, allowed):
# Yes this will just be caught, but thats ok for now...
# Yes this will just be caught, but that's ok for now...
raise TypeError(
"Yaml load allows %s root types, but got %s instead"
% (allowed, type_utils.obj_name(converted))
Expand Down Expand Up @@ -1294,7 +1294,7 @@ def get_fqdn_from_hosts(hostname, filename="/etc/hosts"):
@performance.timed("Resolving URL")
def is_resolvable(url) -> bool:
"""determine if a url's network address is resolvable, return a boolean
This also attempts to be resilent against dns redirection.
This also attempts to be resilient against dns redirection.

Note, that normal nsswitch resolution is used here. So in order
to avoid any utilization of 'search' entries in /etc/resolv.conf
Expand Down Expand Up @@ -1867,7 +1867,7 @@ def load_json(text, root_types=(dict,)):
def get_non_exist_parent_dir(path):
"""Get the last directory in a path that does not exist.

Example: when path=/usr/a/b and /usr/a does not exis but /usr does,
Example: when path=/usr/a/b and /usr/a does not exist but /usr does,
return /usr/a
"""
p_path = os.path.dirname(path)
Expand Down
6 changes: 3 additions & 3 deletions doc/rtd/explanation/exported_errors.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ cloud-init state information is made visible under a top level aggregate key
"Failed at merging in cloud config part from p-01: empty cloud config",
"No template found in /etc/cloud/templates for template source.deb822",
"No template found in /etc/cloud/templates for template sources.list",
"No template found, not rendering /etc/apt/soures.list.d/ubuntu.source"
"No template found, not rendering /etc/apt/sources.list.d/ubuntu.source"
]
},
"status": "done"
Expand Down Expand Up @@ -74,7 +74,7 @@ occurred.
"WARNING": [
"No template found in /etc/cloud/templates for template source.deb822",
"No template found in /etc/cloud/templates for template sources.list",
"No template found, not rendering /etc/apt/soures.list.d/ubuntu.source"
"No template found, not rendering /etc/apt/sources.list.d/ubuntu.source"
]
},
"datasource": "",
Expand All @@ -94,7 +94,7 @@ occurred.
"Failed at merging in cloud config part from p-01: empty cloud config",
"No template found in /etc/cloud/templates for template source.deb822",
"No template found in /etc/cloud/templates for template sources.list",
"No template found, not rendering /etc/apt/soures.list.d/ubuntu.source"
"No template found, not rendering /etc/apt/sources.list.d/ubuntu.source"
]
},
"status": "done"
Expand Down
2 changes: 1 addition & 1 deletion templates/chrony.conf.freebsd.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ ntsdumpdir /var/db/chrony
# gain/loss measurements.
#
# 2. On Linux, if you use the RTC support and start chronyd with
# '-r -s' on bootup, measurements from the last boot will still be
# '-r -s' on boot up, measurements from the last boot will still be
# useful (the real time clock is used to 'flywheel' chronyd between
# boots).
#
Expand Down
2 changes: 1 addition & 1 deletion tests/integration_tests/datasources/test_caching.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def test_no_cache_network_only(client: IntegrationInstance):
- Metadata is fetched in network timeframe only
- Because `check_instance_id` is not defined, no cached datasource
is found in the init-local phase, but the cache is used in the
remaining phases due to existance of /run/cloud-init/.instance-id
remaining phases due to existence of /run/cloud-init/.instance-id
- Because `check_if_fallback_is_allowed` is not defined, cloud-init
does NOT fall back to the pickled datasource, and will
instead delete the cache during the init-local phase
Expand Down
2 changes: 1 addition & 1 deletion tests/integration_tests/modules/test_apt_functionality.py
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,7 @@ def test_install_missing_deps(session_cloud: IntegrationCloud):
# specify a ppa in our user data, and `apt update` can fail if no ppa
# has been uploaded for the release being tested. This isn't uncommon
# for the devel release and newer releases in general.
# Ignoring apt update errors seems preferrable to playing whack-a-mole
# Ignoring apt update errors seems preferable to playing whack-a-mole
# with ppas that may or may not be available.
verify_clean_boot(
minimal_client,
Expand Down
2 changes: 1 addition & 1 deletion tests/integration_tests/modules/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def test_invalid_userdata_schema(client: IntegrationInstance):

@pytest.mark.user_data(FAILING_USER_DATA)
def test_failing_userdata_modules_exit_codes(client: IntegrationInstance):
"""Test failing in modules representd in exit status.
"""Test failing in modules represented in exit status.

To ensure we don't miss any errors or warnings if a service happens
to be restarted, any further module invocations will exit with error
Expand Down
2 changes: 1 addition & 1 deletion tests/integration_tests/modules/test_disk_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,6 @@ def test_required_mounts(create_disk, client: IntegrationInstance):
deps = client.execute(
f"systemctl list-dependencies --all {service}".split()
)
assert "var.mount" in deps, "Exepected 'var.mount' to be a dependency"
assert "var.mount" in deps, "Expected 'var.mount' to be a dependency"

verify_clean_boot(client)
2 changes: 1 addition & 1 deletion tests/integration_tests/reaper.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def __init__(self, timeout: float = 30.0):
self.exit_reaper: Final[threading.Event] = threading.Event()

# List of instances which temporarily escaped death
# The primary porpose of the reaper is to coax these instance towards
# The primary purpose of the reaper is to coax these instance towards
# eventual demise and report their insubordination on shutdown.
self.undead_ledger: Final[List[IntegrationInstance]] = []

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ def test_apt_v3_empty_cfg_source_list_by_distro(

def test_apt_v3_source_list_ubuntu_snappy(self, mocker):
"""test_apt_v3_source_list_ubuntu_snappy - without custom sources or
parms"""
params"""
cfg = {"apt": {}}
mycloud = get_cloud()

Expand Down
2 changes: 1 addition & 1 deletion tests/unittests/config/test_apt_key.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,6 @@ def test_apt_key_list_fail_no_keys_file(self, m_listdir, m_gpg, *args):
@mock.patch.object(cc_apt_configure.os, "listdir", return_value=())
@mock.patch.object(cc_apt_configure.os.path, "isfile", return_value=False)
def test_apt_key_list_fail_bad_key_file(self, m_isfile, m_listdir, m_gpg):
"""Ensure bad gpg key doesn't throw exeption."""
"""Ensure bad gpg key doesn't throw exception."""
m_gpg.list_keys = mock.Mock(side_effect=subp.ProcessExecutionError)
assert not cc_apt_configure.apt_key("list", m_gpg)
2 changes: 1 addition & 1 deletion tests/unittests/config/test_cc_apt_configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ def test_schema_validation(self, config, error_msg):
else:
with pytest.raises(SchemaValidationError, match=error_msg):
validate_cloudconfig_schema(config, schema, strict=True)
# Note apt['primary'] and apt['security'] have same defition
# Note apt['primary'] and apt['security'] have same definition
# Avoid test setup duplicates by running same test using 'security'
if isinstance(config.get("apt"), dict) and config["apt"].get(
"primary"
Expand Down
2 changes: 1 addition & 1 deletion tests/unittests/config/test_cc_landscape.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def test_skip_empty_landscape_cloudconfig(self, m_subp):
assert mycloud.distro.install_packages.called is False

def test_handler_error_on_invalid_landscape_type(self, m_subp):
"""Raise an error when landscape configuraiton option is invalid."""
"""Raise an error when landscape configuration option is invalid."""
mycloud = get_cloud("ubuntu")
cfg = {"landscape": "wrongtype"}
with pytest.raises(RuntimeError) as exc:
Expand Down
2 changes: 1 addition & 1 deletion tests/unittests/config/test_cc_ntp.py
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ def test_snappy_system_picks_timesyncd(self, m_which):

@mock.patch("cloudinit.config.cc_ntp.subp.which")
def test_ntp_distro_searches_all_preferred_clients(self, m_which):
"""Test select_ntp_client search all distro perferred clients"""
"""Test select_ntp_client search all distro preferred clients"""
# nothing is installed
m_which.return_value = None
for distro in cc_ntp.distros:
Expand Down
2 changes: 1 addition & 1 deletion tests/unittests/config/test_cc_zypper_add_repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def test_config_write_skip_configdir(self, tmp_path):
for item in contents.split("\n"):
if item not in expected:
assert item is None
# Not finding teh right path for mocking :(
# Not finding the right path for mocking :(
# assert mock_logging.warning.called

def test_empty_config_section_no_new_data(self, tmp_path):
Expand Down
2 changes: 1 addition & 1 deletion tests/unittests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ def disable_root_logger_setup():
@pytest.fixture
def clear_deprecation_log():
"""Clear any deprecation warnings before and after running tests."""
# Since deprecations are de-duped, the existance (or non-existance) of
# Since deprecations are de-duped, the existence (or non-existence) of
# a deprecation warning in a previous test can cause the next test to
# fail.
setattr(lifecycle.deprecate, "log", set())
Expand Down
4 changes: 2 additions & 2 deletions tests/unittests/distros/test_create_users.py
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ def test_snappy_only_new_group_added(
def test_create_groups_with_whitespace_string(
self, m_is_group, m_subp, dist, mocker
):
# groups supported as a comma delimeted string even with white space
# groups supported as a comma delimited string even with white space
mocker.patch(
"cloudinit.distros.util.system_is_snappy", return_value=False
)
Expand All @@ -534,7 +534,7 @@ def test_create_groups_with_whitespace_string(
def test_snappy_create_groups_with_whitespace_string(
self, m_is_group, m_subp, dist, mocker
):
# groups supported as a comma delimeted string even with white space
# groups supported as a comma delimited string even with white space
mocker.patch(
"cloudinit.distros.util.system_is_snappy", return_value=True
)
Expand Down
2 changes: 1 addition & 1 deletion tests/unittests/net/test_dhcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -1154,7 +1154,7 @@ def test_get_newest_lease_file_from_distro_notfound(self, *_):
"""
Test the case when no leases were found
"""
# Any Distro would suffice for the absense test, choose Centos then.
# Any Distro would suffice for the absence test, choose Centos then.
assert None is IscDhclient.get_newest_lease_file_from_distro(
centos.Distro
)
Expand Down
4 changes: 2 additions & 2 deletions tests/unittests/net/test_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def test_sys_dev_path_without_path(self):
class TestReadSysNet:
@pytest.fixture(autouse=True)
def setup(self, tmpdir_factory):
# We mock invididual numbered tmpdirs here because these tests write
# We mock individual numbered tmpdirs here because these tests write
# to the sysfs directory and stale test artifacts break later tests.
mock_sysfs = f"{tmpdir_factory.mktemp('sysfs', numbered=True)}/"
with mock.patch(
Expand Down Expand Up @@ -638,7 +638,7 @@ def test_get_devicelist_empty_without_sys_net(self):
assert [] == net.get_devicelist()

def test_get_devicelist_empty_with_no_devices_in_sys_net(self):
"""get_devicelist returns empty directoty listing for SYS_CLASS_NET."""
"""get_devicelist returns empty directory listing for SYS_CLASS_NET."""
assert [] == net.get_devicelist()

def test_get_devicelist_lists_any_subdirectories_in_sys_net(self):
Expand Down
2 changes: 1 addition & 1 deletion tests/unittests/sources/test_altcloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def _remove_user_data_files(mount_dir, dc_file=True, non_dc_file=True):
deltacloud_user_data_file = mount_dir + "/deltacloud-user-data.txt"
user_data_file = mount_dir + "/user-data.txt"

# Ignore any failures removeing files that are already gone.
# Ignore any failures removing files that are already gone.
if dc_file:
try:
os.remove(deltacloud_user_data_file)
Expand Down
2 changes: 1 addition & 1 deletion tests/unittests/sources/test_azure.py
Original file line number Diff line number Diff line change
Expand Up @@ -1725,7 +1725,7 @@ def test_password_given(self, get_ds):
# default user should be updated username and should not be locked.
assert defuser["name"] == "myuser"
assert not defuser["lock_passwd"]
# passwd is crypt formated string $id$salt$encrypted
# passwd is crypt formatted string $id$salt$encrypted
# encrypting plaintext with salt value of everything up to final '$'
# should equal that after the '$'
assert passlib.hash.sha512_crypt.verify(
Expand Down
2 changes: 1 addition & 1 deletion tests/unittests/sources/test_configdrive.py
Original file line number Diff line number Diff line change
Expand Up @@ -964,7 +964,7 @@ def test_bond_conversion(self, tmp_path):
)

words = eni_rendering.split()
# 'eth0' and 'eth1' are the ids. because their mac adresses
# 'eth0' and 'eth1' are the ids. because their mac addresses
# map to other names, we should not see them in the ENI
assert "eth0" not in words
assert "eth1" not in words
Expand Down
2 changes: 1 addition & 1 deletion tests/unittests/sources/test_ec2.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ def disable_is_resolvable():
def _register_ssh_keys(rfunc, base_url, keys_data):
r"""handle ssh key inconsistencies.

public-keys in the ec2 metadata is inconsistently formated compared
public-keys in the ec2 metadata is inconsistently formatted compared
to other entries.
Given keys_data of {name1: pubkey1, name2: pubkey2}

Expand Down
2 changes: 1 addition & 1 deletion tests/unittests/sources/test_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ def test_get_hostname_without_metadata_uses_system_hostname(
with mock.patch("cloudinit.sources.util.get_hostname") as m_gethost:
with mock.patch(mock_fqdn) as m_fqdn:
m_gethost.return_value = "systemhostname.domain.com"
m_fqdn.return_value = None # No maching fqdn in /etc/hosts
m_fqdn.return_value = None # No matching fqdn in /etc/hosts
assert "systemhostname" == datasource.get_hostname().hostname
assert (
"systemhostname.domain.com"
Expand Down
2 changes: 1 addition & 1 deletion tests/unittests/sources/test_lxd.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ def test_subplatform(self, lxd_ds):
assert "LXD socket API v. 1.0 (/dev/lxd/sock)" == lxd_ds.subplatform

def test__get_data(self, lxd_ds):
"""get_data calls read_metadata, setting appropiate instance attrs."""
"""get_data calls read_metadata, setting appropriate instance attrs."""
assert UNSET == lxd_ds._crawled_metadata
assert UNSET == lxd_ds._network_config
assert None is lxd_ds.userdata_raw
Expand Down
4 changes: 2 additions & 2 deletions tests/unittests/sources/test_openstack.py
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ def cvj(self, data):
return convert_vendordata(data)

def test_vd_load_none(self):
# non-existant vendor-data should return none
# non-existent vendor-data should return none
assert self.cvj(None) is None

def test_vd_load_string(self):
Expand Down Expand Up @@ -741,7 +741,7 @@ def fake_dmi_read(dmi_key):
if dmi_key == "system-product-name":
return "HVM domU" # Nothing 'openstackish'
if dmi_key == "chassis-asset-tag":
return "" # Nothin 'openstackish'
return "" # Nothing 'openstackish'
assert False, "Unexpected dmi read of %s" % dmi_key

m_dmi.side_effect = fake_dmi_read
Expand Down
2 changes: 1 addition & 1 deletion tests/unittests/sources/test_oracle.py
Original file line number Diff line number Diff line change
Expand Up @@ -1533,7 +1533,7 @@ def test_missing_mac_skipped(
oracle_ds,
caplog,
):
"""If no intefaces by mac found, then _network_config not setted and
"""If no interfaces by mac found, then _network_config not set and
correct logs.
"""
vnics_data = json.loads(OPC_VM_SECONDARY_VNIC_RESPONSE)
Expand Down
Loading