1
0

- 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

OBS-URL: https://build.opensuse.org/package/show/Cloud:OpenStack:Factory/python-glanceclient?expand=0&rev=70
This commit is contained in:
Dirk Mueller 2024-05-06 11:05:03 +00:00 committed by Git OBS Bridge
parent 4fab7ff4fd
commit 7a00ef6d47
6 changed files with 66 additions and 9 deletions

View File

@ -0,0 +1,45 @@
From 300b8c8262d8dcdca7a8d753c3fb8a22cae02d40 Mon Sep 17 00:00:00 2001
From: Takashi Kajinami <kajinamit@oss.nttdata.com>
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

View File

@ -2,7 +2,7 @@
<service mode="manual" name="renderspec">
<param name="input-template">https://opendev.org/openstack/rpm-packaging/raw/master/openstack/python-glanceclient/python-glanceclient.spec.j2</param>
<param name="output-name">python-glanceclient.spec</param>
<param name="requirements">https://opendev.org/openstack/python-glanceclient/raw/branch/stable/xena/requirements.txt</param>
<param name="requirements">https://opendev.org/openstack/python-glanceclient/raw/branch/master/requirements.txt</param>
<param name="changelog-email">cloud-devel@suse.de</param>
<param name="changelog-provider">gh,openstack,python-glanceclient</param>
</service>

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:7a366e1ff66bdb76e627eecf7cd4053bd94f35fa3cdc690d29aff47e976e0532
size 205612

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:9cf7ebf61e28b310df8538420d1788b094f82b9fbab96f793e555ced0ce3aaa3
size 205731

View File

@ -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

View File

@ -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}