diff --git a/Replace_deprecated_import_ABCs_from_collections.patch b/Replace_deprecated_import_ABCs_from_collections.patch new file mode 100644 index 0000000000000000000000000000000000000000..7c087f0d1213a444b1a2eb5e6ca2009a521bb6f2 --- /dev/null +++ b/Replace_deprecated_import_ABCs_from_collections.patch @@ -0,0 +1,50 @@ +diff --git a/oslo_utils/strutils.py b/oslo_utils/strutils.py +index e721fb9..edc180a 100644 +--- a/oslo_utils/strutils.py ++++ b/oslo_utils/strutils.py +@@ -17,7 +17,7 @@ + System-level utilities and helper functions. + """ + +-import collections ++import collections.abc + import math + import re + import unicodedata +@@ -414,12 +414,12 @@ def mask_dict_password(dictionary, secret="***"): # nosec + + """ + +- if not isinstance(dictionary, collections.Mapping): ++ if not isinstance(dictionary, collections.abc.Mapping): + raise TypeError("Expected a Mapping, got %s instead." + % type(dictionary)) + out = {} + for k, v in dictionary.items(): +- if isinstance(v, collections.Mapping): ++ if isinstance(v, collections.abc.Mapping): + out[k] = mask_dict_password(v, secret=secret) + continue + # NOTE(jlvillal): Check to see if anything in the dictionary 'key' +diff --git a/oslo_utils/tests/test_strutils.py b/oslo_utils/tests/test_strutils.py +index 2d6fa70..b30a7b0 100644 +--- a/oslo_utils/tests/test_strutils.py ++++ b/oslo_utils/tests/test_strutils.py +@@ -15,7 +15,7 @@ + # License for the specific language governing permissions and limitations + # under the License. + +-import collections ++import collections.abc + import copy + import math + from unittest import mock +@@ -679,7 +679,7 @@ class MaskPasswordTestCase(test_base.BaseTestCase): + self.assertEqual(expected, strutils.mask_password(payload)) + + +-class TestMapping(collections.Mapping): ++class TestMapping(collections.abc.Mapping): + """Test class for non-dict mappings""" + def __init__(self): + super(TestMapping, self).__init__() diff --git a/python-oslo.utils.spec b/python-oslo.utils.spec index a8e3110b8f3cb3fe0846700e32766e20bb58c90e..8f42f02785cd178df67e89e17f8160686f3313e0 100644 --- a/python-oslo.utils.spec +++ b/python-oslo.utils.spec @@ -1,11 +1,13 @@ %global _empty_manifest_terminate_build 0 Name: python-oslo-utils Version: 4.8.2 -Release: 1 +Release: 2 Summary: Oslo Utility library License: Apache-2.0 URL: https://docs.openstack.org/oslo.utils/latest/ Source0: https://files.pythonhosted.org/packages/94/02/bca51a7f24cf79851dc7cef7218ab26cb3f3841ae68de5d2a1c92072e2fc/oslo.utils-4.8.2.tar.gz +Patch00: Replace_deprecated_import_ABCs_from_collections.patch + BuildArch: noarch %description @@ -51,7 +53,7 @@ Provides: python3-oslo-utils-doc The oslo.utils library provides support for common utility type functions, such as encoding, exception handling, string manipulation, and time handling. %prep -%autosetup -n oslo.utils-4.8.2 +%autosetup -n oslo.utils-4.8.2 -p1 %build %py3_build @@ -94,6 +96,9 @@ mv %{buildroot}/doclist.lst . %{_docdir}/* %changelog +* Fri May 31 2024 tzing_t - 4.8.2-2 +- Replace deprecated import ABCs from collections + * Thu Apr 27 2023 songchao - 4.8.2-1 - Upgrade version to 4.8.2 * Mon Jul 19 2021 yaozc701 - 4.8.0-1