Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-glanceclient for 
openSUSE:Factory checked in at 2024-05-06 17:55:13
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-glanceclient (Old)
 and      /work/SRC/openSUSE:Factory/.python-glanceclient.new.1880 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-glanceclient"

Mon May  6 17:55:13 2024 rev:39 rq:1172149 version:4.4.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-glanceclient/python-glanceclient.changes  
2024-01-10 21:53:35.367004861 +0100
+++ 
/work/SRC/openSUSE:Factory/.python-glanceclient.new.1880/python-glanceclient.changes
        2024-05-06 17:56:27.130075560 +0200
@@ -1,0 +2,9 @@
+Mon May  6 11:04:35 UTC 2024 - [email protected]
+
+- 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
+
+-------------------------------------------------------------------

Old:
----
  python-glanceclient-4.4.0.tar.gz

New:
----
  0001-Fix-unit-tests-broken-by-requests-mock-1.12.0.patch
  python-glanceclient-4.4.1.tar.gz

BETA DEBUG BEGIN:
  New:
- added 0001-Fix-unit-tests-broken-by-requests-mock-1.12.0.patch
- update to version 4.4.1
BETA DEBUG END:

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-glanceclient.spec ++++++
--- /var/tmp/diff_new_pack.EuVB1T/_old  2024-05-06 17:56:27.606092888 +0200
+++ /var/tmp/diff_new_pack.EuVB1T/_new  2024-05-06 17:56:27.610093034 +0200
@@ -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-stestr
 BuildRequires:  python3-testscenarios
 BuildRequires:  python3-testtools
+BuildRequires:  python3-urllib3 < 2
 BuildRequires:  python3-warlock >= 1.2.0
 BuildArch:      noarch
 
@@ -81,15 +84,15 @@
 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}

++++++ 0001-Fix-unit-tests-broken-by-requests-mock-1.12.0.patch ++++++
>From 300b8c8262d8dcdca7a8d753c3fb8a22cae02d40 Mon Sep 17 00:00:00 2001
From: Takashi Kajinami <[email protected]>
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


++++++ _service ++++++
--- /var/tmp/diff_new_pack.EuVB1T/_old  2024-05-06 17:56:27.658094781 +0200
+++ /var/tmp/diff_new_pack.EuVB1T/_new  2024-05-06 17:56:27.662094927 +0200
@@ -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">[email protected]</param>
     <param name="changelog-provider">gh,openstack,python-glanceclient</param>
   </service>

++++++ python-glanceclient-4.4.0.tar.gz -> python-glanceclient-4.4.1.tar.gz 
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/python-glanceclient-4.4.0/ChangeLog 
new/python-glanceclient-4.4.1/ChangeLog
--- old/python-glanceclient-4.4.0/ChangeLog     2023-07-07 16:30:09.000000000 
+0200
+++ new/python-glanceclient-4.4.1/ChangeLog     2024-03-18 15:04:37.000000000 
+0100
@@ -1,6 +1,13 @@
 CHANGES
 =======
 
+4.4.1
+-----
+
+* Remove incorrect validation for glance-download import method
+* Update TOX\_CONSTRAINTS\_FILE for stable/2023.2
+* Update .gitreview for stable/2023.2
+
 4.4.0
 -----
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/python-glanceclient-4.4.0/PKG-INFO 
new/python-glanceclient-4.4.1/PKG-INFO
--- old/python-glanceclient-4.4.0/PKG-INFO      2023-07-07 16:30:10.094164000 
+0200
+++ new/python-glanceclient-4.4.1/PKG-INFO      2024-03-18 15:04:37.868932000 
+0100
@@ -1,6 +1,6 @@
 Metadata-Version: 1.2
 Name: python-glanceclient
-Version: 4.4.0
+Version: 4.4.1
 Summary: OpenStack Image API Client Library
 Home-page: https://docs.openstack.org/python-glanceclient/latest/
 Author: OpenStack
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/python-glanceclient-4.4.0/glanceclient/tests/unit/v2/test_shell_v2.py 
new/python-glanceclient-4.4.1/glanceclient/tests/unit/v2/test_shell_v2.py
--- old/python-glanceclient-4.4.0/glanceclient/tests/unit/v2/test_shell_v2.py   
2023-07-07 16:29:41.000000000 +0200
+++ new/python-glanceclient-4.4.1/glanceclient/tests/unit/v2/test_shell_v2.py   
2024-03-18 15:03:53.000000000 +0100
@@ -2262,6 +2262,74 @@
                         all_stores=None, allow_failure=True,
                         backend=None, stores=None)
 
+    @mock.patch('glanceclient.common.utils.exit')
+    def test_image_import_neg_no_glance_download_with_remote_region(
+            self, mock_utils_exit):
+        expected_msg = ("Import method should be 'glance-download' if "
+                        "REMOTE REGION is provided.")
+        my_args = self.base_args.copy()
+        my_args['id'] = 'IMG-01'
+        my_args['remote_region'] = 'REGION2'
+        my_args['import_method'] = 'web-download'
+        my_args['uri'] = 'https://example.com/some/stuff'
+        args = self._make_args(my_args)
+        mock_utils_exit.side_effect = self._mock_utils_exit
+        with mock.patch.object(self.gc.images,
+                               'get_import_info') as mocked_info:
+            mocked_info.return_value = self.import_info_response
+            try:
+                test_shell.do_image_import(self.gc, args)
+                self.fail("utils.exit should have been called")
+            except SystemExit:
+                pass
+        mock_utils_exit.assert_called_once_with(expected_msg)
+
+    @mock.patch('glanceclient.common.utils.exit')
+    def test_image_import_neg_no_glance_download_with_remote_id(
+            self, mock_utils_exit):
+        expected_msg = ("Import method should be 'glance-download' if "
+                        "REMOTE IMAGE ID is provided.")
+        my_args = self.base_args.copy()
+        my_args['id'] = 'IMG-01'
+        my_args['remote_image_id'] = 'IMG-02'
+        my_args['import_method'] = 'web-download'
+        my_args['uri'] = 'https://example.com/some/stuff'
+        args = self._make_args(my_args)
+        mock_utils_exit.side_effect = self._mock_utils_exit
+        with mock.patch.object(self.gc.images,
+                               'get_import_info') as mocked_info:
+            mocked_info.return_value = self.import_info_response
+            try:
+                test_shell.do_image_import(self.gc, args)
+                self.fail("utils.exit should have been called")
+            except SystemExit:
+                pass
+        mock_utils_exit.assert_called_once_with(expected_msg)
+
+    def test_image_import_glance_download_without_remote_service_interface(
+            self):
+        args = self._make_args(
+            {'id': 'IMG-01', 'uri': None, 'remote_region': 'REGION2',
+             'remote_image_id': 'IMG-02',
+             'import_method': 'glance-download'})
+        with mock.patch.object(self.gc.images, 'image_import') as mock_import:
+            with mock.patch.object(self.gc.images, 'get') as mocked_get:
+                with mock.patch.object(self.gc.images,
+                                       'get_import_info') as mocked_info:
+                    mocked_get.return_value = {'status': 'queued',
+                                               'container_format': 'bare',
+                                               'disk_format': 'raw'}
+                    mocked_info.return_value = self.import_info_response
+                    mock_import.return_value = None
+                    test_shell.do_image_import(self.gc, args)
+                    mock_import.assert_called_once_with(
+                        'IMG-01', 'glance-download',
+                        uri=None, remote_region='REGION2',
+                        remote_image_id='IMG-02',
+                        remote_service_interface=None,
+                        all_stores=None, allow_failure=True,
+                        backend=None, stores=None)
+
     @mock.patch('glanceclient.common.utils.print_image')
     def test_image_import_no_print_image(self, mocked_utils_print_image):
         args = self._make_args(
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/python-glanceclient-4.4.0/glanceclient/v2/shell.py 
new/python-glanceclient-4.4.1/glanceclient/v2/shell.py
--- old/python-glanceclient-4.4.0/glanceclient/v2/shell.py      2023-07-07 
16:29:41.000000000 +0200
+++ new/python-glanceclient-4.4.1/glanceclient/v2/shell.py      2024-03-18 
15:03:53.000000000 +0100
@@ -838,9 +838,6 @@
     if remote_image_id and args.import_method != 'glance-download':
         utils.exit("Import method should be 'glance-download' if "
                    "REMOTE IMAGE ID is provided.")
-    if remote_service_interface and args.import_method != 'glance-download':
-        utils.exit("Import method should be 'glance-download' if "
-                   "REMOTE SERVICE INTERFACE is provided.")
 
     if args.import_method == 'copy-image' and not (stores or all_stores):
         utils.exit("Provide either --stores or --all-stores for "
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/python-glanceclient-4.4.0/python_glanceclient.egg-info/PKG-INFO 
new/python-glanceclient-4.4.1/python_glanceclient.egg-info/PKG-INFO
--- old/python-glanceclient-4.4.0/python_glanceclient.egg-info/PKG-INFO 
2023-07-07 16:30:09.000000000 +0200
+++ new/python-glanceclient-4.4.1/python_glanceclient.egg-info/PKG-INFO 
2024-03-18 15:04:37.000000000 +0100
@@ -1,6 +1,6 @@
 Metadata-Version: 1.2
 Name: python-glanceclient
-Version: 4.4.0
+Version: 4.4.1
 Summary: OpenStack Image API Client Library
 Home-page: https://docs.openstack.org/python-glanceclient/latest/
 Author: OpenStack
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/python-glanceclient-4.4.0/python_glanceclient.egg-info/pbr.json 
new/python-glanceclient-4.4.1/python_glanceclient.egg-info/pbr.json
--- old/python-glanceclient-4.4.0/python_glanceclient.egg-info/pbr.json 
2023-07-07 16:30:09.000000000 +0200
+++ new/python-glanceclient-4.4.1/python_glanceclient.egg-info/pbr.json 
2024-03-18 15:04:37.000000000 +0100
@@ -1 +1 @@
-{"git_version": "62e6fc8", "is_release": true}
\ No newline at end of file
+{"git_version": "d739d31", "is_release": true}
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/python-glanceclient-4.4.0/tox.ini 
new/python-glanceclient-4.4.1/tox.ini
--- old/python-glanceclient-4.4.0/tox.ini       2023-07-07 16:29:41.000000000 
+0200
+++ new/python-glanceclient-4.4.1/tox.ini       2024-03-18 15:03:53.000000000 
+0100
@@ -13,7 +13,7 @@
 # first one that is defined. If none of them is defined, we fallback to the
 # default value.
 deps =
-       
-c{env:TOX_CONSTRAINTS_FILE:{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}}
+       
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/2023.2}
        -r{toxinidir}/requirements.txt
        -r{toxinidir}/test-requirements.txt
 commands = stestr run --slowest {posargs}
@@ -67,7 +67,7 @@
 # first one that is defined. If none of them is defined, we fallback to the
 # default value.
 deps =
-  
-c{env:TOX_CONSTRAINTS_FILE:{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}}
+  
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/2023.2}
   -r{toxinidir}/doc/requirements.txt
 commands =
   sphinx-build -a -E -W -d releasenotes/build/doctrees -b html 
releasenotes/source releasenotes/build/html

Reply via email to