From 6198eaf821dd5d2406d98e43c4ad2330aa696e06 Mon Sep 17 00:00:00 2001 From: tzing_t Date: Fri, 31 May 2024 08:41:26 +0000 Subject: [PATCH] Replace deprecated import ABCs from collections (cherry picked from commit f3d907f52ad00629760676a20e04fe802cb6c53f) --- ...recated_import_ABCs_from_collections.patch | 22 +++++++++++++++++++ openstack-tempest.spec | 8 +++++-- 2 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 Replace_deprecated_import_ABCs_from_collections.patch diff --git a/Replace_deprecated_import_ABCs_from_collections.patch b/Replace_deprecated_import_ABCs_from_collections.patch new file mode 100644 index 0000000..f61d764 --- /dev/null +++ b/Replace_deprecated_import_ABCs_from_collections.patch @@ -0,0 +1,22 @@ +diff --git a/tempest/lib/common/rest_client.py b/tempest/lib/common/rest_client.py +index 00f2aeb..546fcc4 100644 +--- a/tempest/lib/common/rest_client.py ++++ b/tempest/lib/common/rest_client.py +@@ -14,7 +14,7 @@ + # License for the specific language governing permissions and limitations + # under the License. + +-import collections ++from collections import abc + import email.utils + import re + import time +@@ -885,7 +885,7 @@ class RestClient(object): + resp=resp) + + def is_absolute_limit(self, resp, resp_body): +- if (not isinstance(resp_body, collections.Mapping) or ++ if (not isinstance(resp_body, abc.Mapping) or + 'retry-after' not in resp): + return True + return 'exceed' in resp_body.get('message', 'blabla') diff --git a/openstack-tempest.spec b/openstack-tempest.spec index d709b1e..b648db8 100644 --- a/openstack-tempest.spec +++ b/openstack-tempest.spec @@ -8,12 +8,13 @@ other specific tests useful in validating an OpenStack deployment. Name: openstack-%{project} Version: 27.0.0 -Release: 1 +Release: 2 Summary: OpenStack Integration Test Suite (Tempest) License: ASL 2.0 Url: https://launchpad.net/tempest Source0: http://tarballs.openstack.org/tempest/tempest-%{upstream_version}.tar.gz # Required for tarball sources verification +Patch01: Replace_deprecated_import_ABCs_from_collections.patch BuildArch: noarch # Required for tarball sources verification @@ -110,7 +111,7 @@ It contains the documentation for Tempest. %endif %prep -%autosetup -n tempest-%{upstream_version} +%autosetup -n tempest-%{upstream_version} -p1 # have dependencies being handled by rpms, rather than requirement files %py_req_cleanup @@ -185,6 +186,9 @@ PYTHON=%{__python3} stestr --test-path $OS_TEST_PATH run %endif %changelog +* Sat May 25 2024 tzing_t - 1:27.0.0-2 +- Replace deprecated import ABCs from collections + * Fri Jul 23 2021 liksh 1:27.0.0-1 - Update to 27.0.0 -- Gitee