diff -Nru cloud-init-23.2.1/ChangeLog cloud-init-23.2.2/ChangeLog --- cloud-init-23.2.1/ChangeLog 2023-06-27 22:49:12.000000000 +0000 +++ cloud-init-23.2.2/ChangeLog 2023-07-26 15:49:03.000000000 +0000 @@ -1,3 +1,8 @@ +23.2.2 + - Fix NoCloud kernel commandline key parsing (#4273) (Fixes: #4271) + (LP: #2028562) + - Fix reference before assignment (#4292) (Fixes: #4288) (LP: #2028784) + 23.2.1 - nocloud: parse_cmdline no longer detects nocloud-net datasource (#4204) (Fixes: 4203) (LP: #2025180) diff -Nru cloud-init-23.2.1/cloudinit/importer.py cloud-init-23.2.2/cloudinit/importer.py --- cloud-init-23.2.1/cloudinit/importer.py 2023-06-27 22:49:12.000000000 +0000 +++ cloud-init-23.2.2/cloudinit/importer.py 2023-07-26 15:49:03.000000000 +0000 @@ -40,16 +40,16 @@ if "nocloud-net" == mod_name.lower(): mod_name = mod_name[:-4] if not mod_name.startswith("DataSource"): - ds_name = f"DataSource{mod_name}" + mod_name = f"DataSource{mod_name}" modules = {} spec = importlib.util.find_spec("cloudinit.sources") if spec and spec.submodule_search_locations: for dir in spec.submodule_search_locations: modules.update(util.get_modules_from_dir(dir)) for module in modules.values(): - if module.lower() == ds_name.lower(): + if module.lower() == mod_name.lower(): return module - return ds_name + return mod_name def find_module( diff -Nru cloud-init-23.2.1/cloudinit/version.py cloud-init-23.2.2/cloudinit/version.py --- cloud-init-23.2.1/cloudinit/version.py 2023-06-27 22:49:12.000000000 +0000 +++ cloud-init-23.2.2/cloudinit/version.py 2023-07-26 15:49:03.000000000 +0000 @@ -4,7 +4,7 @@ # # This file is part of cloud-init. See LICENSE file for license information. -__VERSION__ = "23.2.1" +__VERSION__ = "23.2.2" _PACKAGED_VERSION = "@@PACKAGED_VERSION@@" FEATURES = [ diff -Nru cloud-init-23.2.1/debian/changelog cloud-init-23.2.2/debian/changelog --- cloud-init-23.2.1/debian/changelog 2023-06-28 20:14:31.000000000 +0000 +++ cloud-init-23.2.2/debian/changelog 2023-08-01 12:12:28.000000000 +0000 @@ -1,3 +1,12 @@ +cloud-init (23.2.2-0ubuntu0~23.04.1) lunar; urgency=medium + + * Upstream snapshot based on 23.2.2. + List of changes from upstream can be found at + https://raw.githubusercontent.com/canonical/cloud-init/23.2.2/ChangeLog + - Bugs fixed in this snapshot: (LP: #2028562, #2028784) + + -- Alberto Contreras Tue, 01 Aug 2023 14:12:28 +0200 + cloud-init (23.2.1-0ubuntu0~23.04.1) lunar; urgency=medium * Upstream snapshot based on 23.2.1. (LP: #2025180). diff -Nru cloud-init-23.2.1/tests/integration_tests/test_kernel_commandline_match.py cloud-init-23.2.2/tests/integration_tests/test_kernel_commandline_match.py --- cloud-init-23.2.1/tests/integration_tests/test_kernel_commandline_match.py 2023-06-27 22:49:12.000000000 +0000 +++ cloud-init-23.2.2/tests/integration_tests/test_kernel_commandline_match.py 2023-07-26 15:49:03.000000000 +0000 @@ -66,7 +66,7 @@ "ds_str, configured", ( ( - "ds=nocloud;s=http://my-url/", + "ds=nocloud;s=http://my-url/;h=hostname", "DataSourceNoCloud [seed=None][dsmode=net]", ), ("ci.ds=openstack", "DataSourceOpenStack"), diff -Nru cloud-init-23.2.1/tests/unittests/test_importer.py cloud-init-23.2.2/tests/unittests/test_importer.py --- cloud-init-23.2.1/tests/unittests/test_importer.py 1970-01-01 00:00:00.000000000 +0000 +++ cloud-init-23.2.2/tests/unittests/test_importer.py 2023-07-26 15:49:03.000000000 +0000 @@ -0,0 +1,24 @@ +import pytest + +from cloudinit.importer import match_case_insensitive_module_name + + +@pytest.mark.parametrize( + "m_name,m_match", + ( + pytest.param( + "nocloud-net", + "DataSourceNoCloud", + id="nocloud-net is a special case, make sure it works", + ), + pytest.param( + "nocloud", + "DataSourceNoCloud", + id="nocloud is a special case, make sure it works", + ), + pytest.param("DataSourceGCE", "DataSourceGCE", id="gce, full name"), + pytest.param("gce", "DataSourceGCE", id="gce, name match"), + ), +) +def test_importer(m_name, m_match): + assert m_match == match_case_insensitive_module_name(m_name) diff -Nru cloud-init-23.2.1/tools/ds-identify cloud-init-23.2.2/tools/ds-identify --- cloud-init-23.2.1/tools/ds-identify 2023-06-27 22:49:12.000000000 +0000 +++ cloud-init-23.2.2/tools/ds-identify 2023-07-26 15:49:03.000000000 +0000 @@ -1740,8 +1740,8 @@ key=${tok%%=*} val=${tok#*=} - # discard anything after delimiter - val=${val%;*} + # discard anything after the first delimiter + val=${val%%;*} case "$key" in ds) _rc_dsname="$val";; ci.ds) _rc_dsname="$val";;