diff --git a/0001-Fix-unit-tests-broken-by-requests-mock-1.12.0.patch b/0001-Fix-unit-tests-broken-by-requests-mock-1.12.0.patch new file mode 100644 index 0000000..3625c38 --- /dev/null +++ b/0001-Fix-unit-tests-broken-by-requests-mock-1.12.0.patch @@ -0,0 +1,45 @@ +From 300b8c8262d8dcdca7a8d753c3fb8a22cae02d40 Mon Sep 17 00:00:00 2001 +From: Takashi Kajinami +Date: Sun, 28 Apr 2024 22:19:24 +0900 +Subject: [PATCH] Fix unit tests broken by requests-mock >= 1.12.0 + +requests-mock removed the old compatibility code in 1.12.0[1] and now +usage of a bare dict for response header causes AttributeError. + +[1] https://github.com/jamielennox/requests-mock/commit/e3bd0d1a92e40fa9cb1d587c59157020a45de620 + +Closes-Bug: #2064011 +Change-Id: Iee86fa3eae86102112987b8648ada73d37ac58e8 +--- + glanceclient/tests/utils.py | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/glanceclient/tests/utils.py b/glanceclient/tests/utils.py +index 730b928..750fb7e 100644 +--- a/glanceclient/tests/utils.py ++++ b/glanceclient/tests/utils.py +@@ -14,6 +14,7 @@ + # under the License. + + import copy ++from email.message import EmailMessage + import io + import json + import testtools +@@ -112,7 +113,12 @@ class FakeResponse(object): + self.body = body + self.reason = reason + self.version = version +- self.headers = headers ++ # NOTE(tkajinam): Make the FakeResponse class compatible with ++ # http.client.HTTPResponse ++ # https://docs.python.org/3/library/http.client.html ++ self.headers = EmailMessage() ++ for header_key in headers: ++ self.headers[header_key] = headers[header_key] + self.headers['x-openstack-request-id'] = 'req-1234' + self.status_code = status_code + self.raw = RawRequest(headers, body=body, reason=reason, +-- +2.44.0 + diff --git a/_service b/_service index df7fc39..0a6665a 100644 --- a/_service +++ b/_service @@ -2,7 +2,7 @@ https://opendev.org/openstack/rpm-packaging/raw/master/openstack/python-glanceclient/python-glanceclient.spec.j2 python-glanceclient.spec - https://opendev.org/openstack/python-glanceclient/raw/branch/stable/xena/requirements.txt + https://opendev.org/openstack/python-glanceclient/raw/branch/master/requirements.txt cloud-devel@suse.de gh,openstack,python-glanceclient diff --git a/python-glanceclient-4.4.0.tar.gz b/python-glanceclient-4.4.0.tar.gz deleted file mode 100644 index 950ff2b..0000000 --- a/python-glanceclient-4.4.0.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:7a366e1ff66bdb76e627eecf7cd4053bd94f35fa3cdc690d29aff47e976e0532 -size 205612 diff --git a/python-glanceclient-4.4.1.tar.gz b/python-glanceclient-4.4.1.tar.gz new file mode 100644 index 0000000..ff4b612 --- /dev/null +++ b/python-glanceclient-4.4.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9cf7ebf61e28b310df8538420d1788b094f82b9fbab96f793e555ced0ce3aaa3 +size 205731 diff --git a/python-glanceclient.changes b/python-glanceclient.changes index fefcc04..355eef3 100644 --- a/python-glanceclient.changes +++ b/python-glanceclient.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Mon May 6 11:04:35 UTC 2024 - cloud-devel@suse.de + +- added 0001-Fix-unit-tests-broken-by-requests-mock-1.12.0.patch +- update to version 4.4.1 + - Update .gitreview for stable/2023.2 + - Update TOX_CONSTRAINTS_FILE for stable/2023.2 + - Remove incorrect validation for glance-download import method + ------------------------------------------------------------------- Wed Jan 10 16:52:29 UTC 2024 - cloud-devel@suse.de diff --git a/python-glanceclient.spec b/python-glanceclient.spec index 5323c6c..412af47 100644 --- a/python-glanceclient.spec +++ b/python-glanceclient.spec @@ -17,14 +17,16 @@ Name: python-glanceclient -Version: 4.4.0 +Version: 4.4.1 Release: 0 Epoch: 0 Summary: Python API and CLI for OpenStack Glance License: Apache-2.0 Group: Development/Languages/Python URL: https://docs.openstack.org/python-glanceclient -Source0: https://files.pythonhosted.org/packages/source/p/python-glanceclient/python-glanceclient-4.4.0.tar.gz +Source0: https://files.pythonhosted.org/packages/source/p/python-glanceclient/python-glanceclient-4.4.1.tar.gz +# https://review.opendev.org/c/openstack/python-glanceclient/+/917275 +Patch1: 0001-Fix-unit-tests-broken-by-requests-mock-1.12.0.patch BuildRequires: openstack-macros BuildRequires: python3-PrettyTable >= 0.7.1 BuildRequires: python3-ddt @@ -38,6 +40,7 @@ BuildRequires: python3-requests-mock BuildRequires: python3-stestr BuildRequires: python3-testscenarios BuildRequires: python3-testtools +BuildRequires: python3-urllib3 < 2 BuildRequires: python3-warlock >= 1.2.0 BuildArch: noarch @@ -81,15 +84,15 @@ glanceclient module), and a command-line script (glance). Each implements This package contains auto-generated documentation. %prep -%autosetup -p1 -n python-glanceclient-4.4.0 +%autosetup -p1 -n python-glanceclient-4.4.1 %py_req_cleanup %build %py3_build # generate html docs -PBR_VERSION=4.4.0 %sphinx_build -b html doc/source doc/build/html -PBR_VERSION=4.4.0 %sphinx_build -b man doc/source doc/build/man +PBR_VERSION=4.4.1 %sphinx_build -b html doc/source doc/build/html +PBR_VERSION=4.4.1 %sphinx_build -b man doc/source doc/build/man # remove the sphinx-build leftovers rm -rf doc/build/html/.{doctrees,buildinfo} rm -rf doc/build/man/.{doctrees,buildinfo}