diff --git a/cloud-init-update-test-characters-in-substitution-unit-test.patch b/cloud-init-update-test-characters-in-substitution-unit-test.patch new file mode 100644 index 0000000..6687b6b --- /dev/null +++ b/cloud-init-update-test-characters-in-substitution-unit-test.patch @@ -0,0 +1,19 @@ +--- a/cloudinit/distros/tests/test_init.py ++++ b/cloudinit/distros/tests/test_init.py +@@ -11,10 +11,15 @@ import pytest + + from cloudinit.distros import _get_package_mirror_info, LDH_ASCII_CHARS + ++# In newer versions of Python, these characters will be omitted instead ++# of substituted because of security concerns. ++# See https://bugs.python.org/issue43882 ++SECURITY_URL_CHARS = '\n\r\t' + + # Define a set of characters we would expect to be replaced + INVALID_URL_CHARS = [ +- chr(x) for x in range(127) if chr(x) not in LDH_ASCII_CHARS ++ chr(x) for x in range(127) ++ if chr(x) not in LDH_ASCII_CHARS + SECURITY_URL_CHARS + ] + for separator in [":", ".", "/", "#", "?", "@", "[", "]"]: + # Remove from the set characters that either separate hostname parts (":", diff --git a/cloud-init.changes b/cloud-init.changes index ff72eb6..76cd05a 100644 --- a/cloud-init.changes +++ b/cloud-init.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Aug 12 02:16:08 UTC 2021 - Fusion Future + +- Add cloud-init-update-test-characters-in-substitution-unit-test.patch + to fix unit test fail in TestGetPackageMirrorInfo::test_substitution. + ------------------------------------------------------------------- Fri Jul 9 10:45:23 UTC 2021 - Antonio Larrosa diff --git a/cloud-init.spec b/cloud-init.spec index aed7b98..66aa343 100644 --- a/cloud-init.spec +++ b/cloud-init.spec @@ -52,6 +52,8 @@ Patch73: cloud-init-no-pwd-in-log.patch Patch74: cloud-init-purge-cache-py-ver-change.patch # PATCH-FIX-UPSTREAM https://github.com/canonical/cloud-init/commit/f23a4c4262ac11cd75c99fcbfbfe453f4e115f18 Patch75: 0001-templater-drop-Jinja-Python-2-compatibility-shim.patch +# PATCH-FIX-UPSTREAM https://github.com/canonical/cloud-init/commit/899bfaa9d6bfab1db0df99257628ca1f6febff60 +Patch76: cloud-init-update-test-characters-in-substitution-unit-test.patch BuildRequires: fdupes BuildRequires: filesystem # pkg-config is needed to find correct systemd unit dir @@ -161,6 +163,7 @@ Documentation and examples for cloud-init tools %if 0%{?suse_version} >= 1550 %patch75 -p1 %endif +%patch76 -p1 # patch in the full version to version.py version_pys=$(find . -name version.py -type f) [ -n "$version_pys" ] ||