From bf3841c6e3be552c52cb5ac9b94f1cedfa776e2ffc195a5a4b7911fa455f3987 Mon Sep 17 00:00:00 2001 From: Robert Schweikert Date: Thu, 12 Aug 2021 11:24:32 +0000 Subject: [PATCH] Accepting request 911508 from home:fusionfuture:branches:Cloud:Tools - Add cloud-init-update-test-characters-in-substitution-unit-test.patch to fix unit test fail in TestGetPackageMirrorInfo::test_substitution. OBS-URL: https://build.opensuse.org/request/show/911508 OBS-URL: https://build.opensuse.org/package/show/Cloud:Tools/cloud-init?expand=0&rev=188 --- ...characters-in-substitution-unit-test.patch | 19 +++++++++++++++++++ cloud-init.changes | 6 ++++++ cloud-init.spec | 3 +++ 3 files changed, 28 insertions(+) create mode 100644 cloud-init-update-test-characters-in-substitution-unit-test.patch 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" ] ||