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 2023-01-05 15:00:37
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-glanceclient (Old)
 and      /work/SRC/openSUSE:Factory/.python-glanceclient.new.1563 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-glanceclient"

Thu Jan  5 15:00:37 2023 rev:36 rq:1055987 version:4.2.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-glanceclient/python-glanceclient.changes  
2022-05-25 20:34:33.532227361 +0200
+++ 
/work/SRC/openSUSE:Factory/.python-glanceclient.new.1563/python-glanceclient.changes
        2023-01-05 15:00:56.341047522 +0100
@@ -1,0 +2,16 @@
+Thu Dec  1 10:45:00 UTC 2022 - cloud-de...@suse.de
+
+- update to version 4.2.0
+  - schema_args: Do not generate option for read-only properties
+  - Add support for glance-download import method
+  - Delete python bytecode before every test run
+  - Update master for stable/zed
+  - Uncap warlock
+  - Check if stdin has isatty attribute
+  - Bump default pagesize
+  - Remove incorrect note from requirements files
+  - Make "tox -edocs" generate the manpage
+  - Switch to 2023.1 Python3 unit tests and generic template name
+  - Bump tox minversion to 3.18.0
+
+-------------------------------------------------------------------

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

New:
----
  python-glanceclient-4.2.0.tar.gz

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

Other differences:
------------------
++++++ python-glanceclient.spec ++++++
--- /var/tmp/diff_new_pack.ZpUKsf/_old  2023-01-05 15:00:56.889050411 +0100
+++ /var/tmp/diff_new_pack.ZpUKsf/_new  2023-01-05 15:00:56.893050433 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package python-glanceclient
 #
-# Copyright (c) 2022 SUSE LLC
+# Copyright (c) 2023 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,14 +17,14 @@
 
 
 Name:           python-glanceclient
-Version:        4.0.0
+Version:        4.2.0
 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.0.0.tar.gz
+Source0:        
https://files.pythonhosted.org/packages/source/p/python-glanceclient/python-glanceclient-4.2.0.tar.gz
 BuildRequires:  openstack-macros
 BuildRequires:  python3-PrettyTable >= 0.7.1
 BuildRequires:  python3-ddt
@@ -81,15 +81,15 @@
 This package contains auto-generated documentation.
 
 %prep
-%autosetup -p1 -n python-glanceclient-4.0.0
+%autosetup -p1 -n python-glanceclient-4.2.0
 %py_req_cleanup
 
 %build
 %py3_build
 
 # generate html docs
-PBR_VERSION=4.0.0 %sphinx_build -b html doc/source doc/build/html
-PBR_VERSION=4.0.0 %sphinx_build -b man doc/source doc/build/man
+PBR_VERSION=4.2.0 %sphinx_build -b html doc/source doc/build/html
+PBR_VERSION=4.2.0 %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}

++++++ python-glanceclient-4.0.0.tar.gz -> python-glanceclient-4.2.0.tar.gz 
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/python-glanceclient-4.0.0/.zuul.yaml 
new/python-glanceclient-4.2.0/.zuul.yaml
--- old/python-glanceclient-4.0.0/.zuul.yaml    2022-05-20 22:34:02.000000000 
+0200
+++ new/python-glanceclient-4.2.0/.zuul.yaml    2022-11-16 14:49:52.000000000 
+0100
@@ -79,7 +79,7 @@
       - check-requirements
       - lib-forward-testing-python3
       - openstack-cover-jobs
-      - openstack-python3-zed-jobs
+      - openstack-python3-jobs
       - publish-openstack-docs-pti
       - release-notes-jobs-python3
     check:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/python-glanceclient-4.0.0/AUTHORS 
new/python-glanceclient-4.2.0/AUTHORS
--- old/python-glanceclient-4.0.0/AUTHORS       2022-05-20 22:34:28.000000000 
+0200
+++ new/python-glanceclient-4.2.0/AUTHORS       2022-11-16 14:50:20.000000000 
+0100
@@ -24,6 +24,7 @@
 Anita Kuno <ak...@lavabit.com>
 Ankit Agrawal <ankit11.agra...@nttdata.com>
 Atsushi SAKAI <sak...@jp.fujitsu.com>
+Benedikt Loeffler <benedikt.loeff...@bmw.de>
 Bhuvan Arumugam <bhu...@apache.org>
 Bob Thyne <bob.th...@hp.com>
 Boris Pavlovic <bo...@pavlovic.me>
@@ -200,6 +201,7 @@
 Sulochan Acharya <suloc...@gmail.com>
 Sushil Kumar <sushil.kum...@globallogic.com>
 Swapnil Kulkarni (coolsvap) <m...@coolsvap.net>
+Takashi Kajinami <tkaji...@redhat.com>
 Takashi NATSUME <natsume.taka...@lab.ntt.co.jp>
 Takeaki Matsumoto <takeaki.matsum...@ntt.com>
 Tatyana Leontovich <tleon...@yahoo-inc.com>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/python-glanceclient-4.0.0/ChangeLog 
new/python-glanceclient-4.2.0/ChangeLog
--- old/python-glanceclient-4.0.0/ChangeLog     2022-05-20 22:34:28.000000000 
+0200
+++ new/python-glanceclient-4.2.0/ChangeLog     2022-11-16 14:50:20.000000000 
+0100
@@ -1,6 +1,28 @@
 CHANGES
 =======
 
+4.2.0
+-----
+
+* schema\_args: Do not generate option for read-only properties
+* Switch to 2023.1 Python3 unit tests and generic template name
+* Update master for stable/zed
+
+4.1.0
+-----
+
+* Add support for glance-download import method
+* Bump default pagesize
+* Delete python bytecode before every test run
+
+4.0.1
+-----
+
+* Remove incorrect note from requirements files
+* Uncap warlock
+* Check if stdin has isatty attribute
+* Bump tox minversion to 3.18.0
+
 4.0.0
 -----
 
@@ -22,6 +44,7 @@
 * Updating python testing classifier as per Yoga testing runtime
 * Replace deprecated UPPER\_CONSTRAINTS\_FILE variable
 * Remove lower-constraints.txt
+* Make "tox -edocs" generate the manpage
 * Correct releasenote path for member-get command
 * Clean up extra spaces
 * Add Python3 yoga unit tests
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/python-glanceclient-4.0.0/PKG-INFO 
new/python-glanceclient-4.2.0/PKG-INFO
--- old/python-glanceclient-4.0.0/PKG-INFO      2022-05-20 22:34:28.920248000 
+0200
+++ new/python-glanceclient-4.2.0/PKG-INFO      2022-11-16 14:50:20.700069700 
+0100
@@ -1,6 +1,6 @@
 Metadata-Version: 1.2
 Name: python-glanceclient
-Version: 4.0.0
+Version: 4.2.0
 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.0.0/glanceclient/common/utils.py 
new/python-glanceclient-4.2.0/glanceclient/common/utils.py
--- old/python-glanceclient-4.0.0/glanceclient/common/utils.py  2022-05-20 
22:34:02.000000000 +0200
+++ new/python-glanceclient-4.2.0/glanceclient/common/utils.py  2022-11-16 
14:49:52.000000000 +0100
@@ -123,6 +123,8 @@
             for name, property in properties.items():
                 if name in omit:
                     continue
+                if property.get('readOnly', False):
+                    continue
                 param = '--' + name.replace('_', '-')
                 kwargs = {}
 
@@ -447,7 +449,7 @@
         except OSError:
             # (1) stdin is not valid (closed...)
             return None
-        if not sys.stdin.isatty():
+        if hasattr(sys.stdin, 'isatty') and not sys.stdin.isatty():
             # (2) image data is provided through standard input
             image = sys.stdin
             if hasattr(sys.stdin, 'buffer'):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/python-glanceclient-4.0.0/glanceclient/tests/unit/test_shell.py 
new/python-glanceclient-4.2.0/glanceclient/tests/unit/test_shell.py
--- old/python-glanceclient-4.0.0/glanceclient/tests/unit/test_shell.py 
2022-05-20 22:34:02.000000000 +0200
+++ new/python-glanceclient-4.2.0/glanceclient/tests/unit/test_shell.py 
2022-11-16 14:49:52.000000000 +0100
@@ -711,7 +711,7 @@
         glance_shell = openstack_shell.OpenStackImagesShell()
         glance_shell.main(args.split())
         self.assertEqual(self.requests.request_history[2].url,
-                         self.image_url + "v2/images?limit=20&"
+                         self.image_url + "v2/images?limit=200&"
                          "sort_key=name&sort_dir=asc")
 
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/python-glanceclient-4.0.0/glanceclient/tests/unit/test_utils.py 
new/python-glanceclient-4.2.0/glanceclient/tests/unit/test_utils.py
--- old/python-glanceclient-4.0.0/glanceclient/tests/unit/test_utils.py 
2022-05-20 22:34:02.000000000 +0200
+++ new/python-glanceclient-4.2.0/glanceclient/tests/unit/test_utils.py 
2022-11-16 14:49:52.000000000 +0100
@@ -191,12 +191,17 @@
         def schema_getter(_type='string', enum=False):
             prop = {
                 'type': ['null', _type],
-                'readOnly': True,
                 'description': 'Test schema',
             }
+            prop_readonly = {
+                'type': ['null', _type],
+                'readOnly': True,
+                'description': 'Test schema read-only',
+            }
 
             if enum:
                 prop['enum'] = [None, 'opt-1', 'opt-2']
+                prop_readonly['enum'] = [None, 'opt-ro-1', 'opt-ro-2']
 
             def actual_getter():
                 return {
@@ -205,6 +210,7 @@
                     'name': 'test_schema',
                     'properties': {
                         'test': prop,
+                        'readonly-test': prop_readonly,
                     }
                 }
 
@@ -214,6 +220,7 @@
             pass
 
         decorated = utils.schema_args(schema_getter())(dummy_func)
+        self.assertEqual(len(decorated.__dict__['arguments']), 1)
         arg, opts = decorated.__dict__['arguments'][0]
         self.assertIn('--test', arg)
         self.assertEqual(encodeutils.safe_decode, opts['type'])
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/python-glanceclient-4.0.0/glanceclient/tests/unit/v2/base.py 
new/python-glanceclient-4.2.0/glanceclient/tests/unit/v2/base.py
--- old/python-glanceclient-4.0.0/glanceclient/tests/unit/v2/base.py    
2022-05-20 22:34:02.000000000 +0200
+++ new/python-glanceclient-4.2.0/glanceclient/tests/unit/v2/base.py    
2022-11-16 14:49:52.000000000 +0100
@@ -113,8 +113,8 @@
         resp = self.controller.deassociate(*args)
         self._assertRequestId(resp)
 
-    def image_import(self, *args):
-        resp = self.controller.image_import(*args)
+    def image_import(self, *args, **kwargs):
+        resp = self.controller.image_import(*args, **kwargs)
         self._assertRequestId(resp)
 
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/python-glanceclient-4.0.0/glanceclient/tests/unit/v2/test_client_requests.py
 
new/python-glanceclient-4.2.0/glanceclient/tests/unit/v2/test_client_requests.py
--- 
old/python-glanceclient-4.0.0/glanceclient/tests/unit/v2/test_client_requests.py
    2022-05-20 22:34:02.000000000 +0200
+++ 
new/python-glanceclient-4.2.0/glanceclient/tests/unit/v2/test_client_requests.py
    2022-11-16 14:49:52.000000000 +0100
@@ -35,7 +35,7 @@
         self.requests = self.useFixture(rm_fixture.Fixture())
         self.requests.get('http://example.com/v2/schemas/image',
                           json=schema_fixture)
-        self.requests.get('http://example.com/v2/images?limit=20',
+        self.requests.get('http://example.com/v2/images?limit=200',
                           json=image_list_fixture)
         gc = client.Client(2.2, "http://example.com/v2.1";)
         images = gc.images.list()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/python-glanceclient-4.0.0/glanceclient/tests/unit/v2/test_images.py 
new/python-glanceclient-4.2.0/glanceclient/tests/unit/v2/test_images.py
--- old/python-glanceclient-4.0.0/glanceclient/tests/unit/v2/test_images.py     
2022-05-20 22:34:02.000000000 +0200
+++ new/python-glanceclient-4.2.0/glanceclient/tests/unit/v2/test_images.py     
2022-11-16 14:49:52.000000000 +0100
@@ -1201,7 +1201,7 @@
         body = ''.join([b for b in body])
         self.assertEqual('GOODCHECKSUM', body)
 
-    def test_image_import(self):
+    def test_image_import_web_download(self):
         uri = 'http://example.com/image.qcow'
         data = [('method', {'name': 'web-download',
                  'uri': uri})]
@@ -1210,6 +1210,24 @@
         expect = [('POST', '/v2/images/%s/import' % image_id, {},
                   data)]
         self.assertEqual(expect, self.api.calls)
+
+    def test_image_import_glance_download(self):
+        region = 'REGION2'
+        remote_image_id = '75baf7b6-253a-11ed-8307-4b1057986a78'
+        image_id = '606b0e88-7c5a-4d54-b5bb-046105d4de6f'
+        service_interface = 'public'
+        data = [('method',
+                 {'name': 'glance-download',
+                  'glance_region': region,
+                  'glance_image_id': remote_image_id,
+                  'glance_service_interface': service_interface})]
+        self.controller.image_import(
+            image_id, 'glance-download', remote_region=region,
+            remote_image_id=remote_image_id,
+            remote_service_interface=service_interface)
+        expect = [('POST', '/v2/images/%s/import' % image_id, {},
+                  data)]
+        self.assertEqual(expect, self.api.calls)
 
     def test_download_no_data(self):
         resp = utils.FakeResponse(headers={}, status_code=204)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/python-glanceclient-4.0.0/glanceclient/tests/unit/v2/test_shell_v2.py 
new/python-glanceclient-4.2.0/glanceclient/tests/unit/v2/test_shell_v2.py
--- old/python-glanceclient-4.0.0/glanceclient/tests/unit/v2/test_shell_v2.py   
2022-05-20 22:34:02.000000000 +0200
+++ new/python-glanceclient-4.2.0/glanceclient/tests/unit/v2/test_shell_v2.py   
2022-11-16 14:49:52.000000000 +0100
@@ -957,12 +957,14 @@
                  'progress': False,
                  'file': None,
                  'uri': None,
+                 'remote_region': None,
                  'import_method': None}
 
     import_info_response = {'import-methods': {
         'type': 'array',
         'description': 'Import methods available.',
-        'value': ['glance-direct', 'web-download', 'copy-image']}}
+        'value': ['glance-direct', 'web-download', 'copy-image',
+                  'glance-download']}}
 
     def _mock_utils_exit(self, msg):
         sys.exit(msg)
@@ -1453,6 +1455,100 @@
 
     @mock.patch('glanceclient.common.utils.exit')
     @mock.patch('sys.stdin', autospec=True)
+    def test_neg_image_create_via_import_glance_download_no_region_and_id(
+            self, mock_stdin, mock_utils_exit):
+        expected_msg = ('REMOTE GlANCE REGION and REMOTE IMAGE ID are '
+                        'required for glance-download import method. '
+                        'Please use --remote-region <region> and '
+                        '--remote-image-id <remote-image-id>.')
+        my_args = self.base_args.copy()
+        my_args['import_method'] = 'glance-download'
+        args = self._make_args(my_args)
+        mock_stdin.isatty = lambda: True
+        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_create_via_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')
+    @mock.patch('sys.stdin', autospec=True)
+    def test_neg_image_create_via_import_glance_download_with_uri(
+            self, mock_stdin, mock_utils_exit):
+        expected_msg = ('You cannot specify a --uri with the '
+                        'glance-download import method.')
+        my_args = self.base_args.copy()
+        my_args['import_method'] = 'glance-download'
+        my_args['remote_region'] = 'REGION2'
+        my_args['remote_image_id'] = 'IMG2'
+        my_args['uri'] = 'https://example.com/some/stuff'
+        args = self._make_args(my_args)
+        mock_stdin.isatty = lambda: True
+        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_create_via_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')
+    @mock.patch('sys.stdin', autospec=True)
+    def test_neg_image_create_via_import_glance_download_with_file(
+            self, mock_stdin, mock_utils_exit):
+        expected_msg = ('You cannot specify a --file with the '
+                        'glance-download import method.')
+        my_args = self.base_args.copy()
+        my_args['import_method'] = 'glance-download'
+        my_args['remote_region'] = 'REGION2'
+        my_args['remote_image_id'] = 'IMG2'
+        my_args['file'] = 'my.browncow'
+        args = self._make_args(my_args)
+        mock_stdin.isatty = lambda: True
+        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_create_via_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')
+    @mock.patch('sys.stdin', autospec=True)
+    def test_neg_image_create_via_import_glance_download_with_data(
+            self, mock_stdin, mock_utils_exit):
+        expected_msg = ('You cannot pass data via stdin with the '
+                        'glance-download import method.')
+        my_args = self.base_args.copy()
+        my_args['import_method'] = 'glance-download'
+        my_args['remote_region'] = 'REGION2'
+        my_args['remote_image_id'] = 'IMG2'
+        args = self._make_args(my_args)
+        mock_stdin.isatty = lambda: False
+        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_create_via_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')
+    @mock.patch('sys.stdin', autospec=True)
     def test_neg_image_create_via_import_bad_method(
             self, mock_stdin, mock_utils_exit):
         expected_msg = ('Import method \'swift-party-time\' is not valid '
@@ -2114,13 +2210,16 @@
                     mock_import.return_value = None
                     test_shell.do_image_import(self.gc, args)
                     mock_import.assert_called_once_with(
-                        'IMG-01', 'glance-direct', None, backend=None,
-                        all_stores=None, allow_failure=True, stores=None)
+                        'IMG-01', 'glance-direct', uri=None,
+                        remote_region=None, remote_image_id=None,
+                        remote_service_interface=None,
+                        backend=None, all_stores=None,
+                        allow_failure=True, stores=None)
 
     def test_image_import_web_download(self):
         args = self._make_args(
             {'id': 'IMG-01', 'uri': 'http://example.com/image.qcow',
-             'import_method': 'web-download'})
+                'import_method': 'web-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,
@@ -2133,7 +2232,33 @@
                     test_shell.do_image_import(self.gc, args)
                     mock_import.assert_called_once_with(
                         'IMG-01', 'web-download',
-                        'http://example.com/image.qcow',
+                        uri='http://example.com/image.qcow',
+                        remote_region=None, remote_image_id=None,
+                        remote_service_interface=None,
+                        all_stores=None, allow_failure=True,
+                        backend=None, stores=None)
+
+    def test_image_import_glance_download(self):
+        args = self._make_args(
+            {'id': 'IMG-01', 'uri': None, 'remote-region': 'REGION2',
+             'remote-image-id': 'IMG-02',
+             'import_method': 'glance-download',
+             'remote-service-interface': 'public'})
+        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='public',
                         all_stores=None, allow_failure=True,
                         backend=None, stores=None)
 
@@ -2175,9 +2300,11 @@
                     mock_import.return_value = None
                     test_shell.do_image_import(self.gc, args)
                     mock_import.assert_called_once_with(
-                        'IMG-02', 'glance-direct', None, all_stores=None,
-                        allow_failure=True, stores=['site1', 'site2'],
-                        backend=None)
+                        'IMG-02', 'glance-direct', uri=None,
+                        remote_region=None, remote_image_id=None,
+                        remote_service_interface=None,
+                        all_stores=None, allow_failure=True,
+                        stores=['site1', 'site2'], backend=None)
 
     @mock.patch('glanceclient.common.utils.print_image')
     @mock.patch('glanceclient.v2.shell._validate_backend')
@@ -2197,9 +2324,11 @@
                     mock_import.return_value = None
                     test_shell.do_image_import(self.gc, args)
                     mock_import.assert_called_once_with(
-                        'IMG-02', 'copy-image', None, all_stores=None,
-                        allow_failure=True, stores=['file1', 'file2'],
-                        backend=None)
+                        'IMG-02', 'copy-image', uri=None,
+                        remote_region=None, remote_image_id=None,
+                        remote_service_interface=None,
+                        all_stores=None, allow_failure=True,
+                        stores=['file1', 'file2'], backend=None)
 
     @mock.patch('glanceclient.common.utils.exit')
     def test_neg_image_import_copy_image_not_active(
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/python-glanceclient-4.0.0/glanceclient/v2/images.py 
new/python-glanceclient-4.2.0/glanceclient/v2/images.py
--- old/python-glanceclient-4.0.0/glanceclient/v2/images.py     2022-05-20 
22:34:02.000000000 +0200
+++ new/python-glanceclient-4.2.0/glanceclient/v2/images.py     2022-11-16 
14:49:52.000000000 +0100
@@ -24,7 +24,7 @@
 from glanceclient import exc
 from glanceclient.v2 import schemas
 
-DEFAULT_PAGE_SIZE = 20
+DEFAULT_PAGE_SIZE = 200
 
 SORT_DIR_VALUES = ('asc', 'desc')
 SORT_KEY_VALUES = ('name', 'status', 'container_format', 'disk_format',
@@ -353,8 +353,9 @@
 
     @utils.add_req_id_to_object()
     def image_import(self, image_id, method='glance-direct', uri=None,
-                     backend=None, stores=None, allow_failure=True,
-                     all_stores=None):
+                     remote_region=None, remote_image_id=None,
+                     remote_service_interface=None, backend=None,
+                     stores=None, allow_failure=True, all_stores=None):
         """Import Image via method."""
         headers = {}
         url = '/v2/images/%s/import' % image_id
@@ -370,6 +371,13 @@
             if allow_failure:
                 data['all_stores_must_succeed'] = False
 
+        if remote_region and remote_image_id:
+            if remote_service_interface:
+                data['method']['glance_service_interface'] = \
+                    remote_service_interface
+            data['method']['glance_region'] = remote_region
+            data['method']['glance_image_id'] = remote_image_id
+
         if uri:
             if method == 'web-download':
                 data['method']['uri'] = uri
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/python-glanceclient-4.0.0/glanceclient/v2/shell.py 
new/python-glanceclient-4.2.0/glanceclient/v2/shell.py
--- old/python-glanceclient-4.0.0/glanceclient/v2/shell.py      2022-05-20 
22:34:02.000000000 +0200
+++ new/python-glanceclient-4.2.0/glanceclient/v2/shell.py      2022-11-16 
14:49:52.000000000 +0100
@@ -49,11 +49,7 @@
     return IMAGE_SCHEMA
 
 
-@utils.schema_args(get_image_schema, omit=['created_at', 'updated_at', 'file',
-                                           'checksum', 'virtual_size', 'size',
-                                           'status', 'schema', 'direct_url',
-                                           'locations', 'self', 'os_hidden',
-                                           'os_hash_value', 'os_hash_algo'])
+@utils.schema_args(get_image_schema, omit=['locations', 'os_hidden'])
 # NOTE(rosmaita): to make this option more intuitive for end users, we
 # do not use the Glance image property name 'os_hidden' here.  This means
 # we must include 'os_hidden' in the 'omit' list above and handle the
@@ -94,7 +90,7 @@
     backend = args.store
 
     file_name = fields.pop('file', None)
-    using_stdin = not sys.stdin.isatty()
+    using_stdin = hasattr(sys.stdin, 'isatty') and not sys.stdin.isatty()
     if args.store and not (file_name or using_stdin):
         utils.exit("--store option should only be provided with --file "
                    "option or stdin.")
@@ -118,11 +114,7 @@
         utils.print_image(image)
 
 
-@utils.schema_args(get_image_schema, omit=['created_at', 'updated_at', 'file',
-                                           'checksum', 'virtual_size', 'size',
-                                           'status', 'schema', 'direct_url',
-                                           'locations', 'self', 'os_hidden',
-                                           'os_hash_value', 'os_hash_algo'])
+@utils.schema_args(get_image_schema, omit=['locations', 'os_hidden'])
 # NOTE: --hidden requires special handling; see note at do_image_create
 @utils.arg('--hidden', type=strutils.bool_from_string, metavar='[True|False]',
            default=None,
@@ -148,6 +140,14 @@
                   'record if no import-method and no data is supplied'))
 @utils.arg('--uri', metavar='<IMAGE_URL>', default=None,
            help=_('URI to download the external image.'))
+@utils.arg('--remote-region', metavar='<GLANCE_REGION>', default=None,
+           help=_('REMOTE_GLANCE_REGION to download the image.'))
+@utils.arg('--remote-image-id', metavar='<REMOTE_IMAGE_ID>', default=None,
+           help=_('The IMAGE ID of the image of remote glance, which needs'
+                  'to be imported with glance-download'))
+@utils.arg('--remote-service-interface', metavar='<REMOTE_SERVICE_INTERFACE>',
+           default='public',
+           help=_('The Remote Glance Service Interface for glance-download'))
 @utils.arg('--store', metavar='<STORE>',
            default=utils.env('OS_IMAGE_STORE', default=None),
            help='Backend store to upload image to.')
@@ -205,7 +205,7 @@
         fields[key] = value
 
     file_name = fields.pop('file', None)
-    using_stdin = not sys.stdin.isatty()
+    using_stdin = hasattr(sys.stdin, 'isatty') and not sys.stdin.isatty()
 
     # special processing for backward compatibility with image-create
     if args.import_method is None and (file_name or using_stdin):
@@ -293,6 +293,22 @@
             utils.exit("You cannot pass data via stdin with the web-download "
                        "import method.")
 
+    if args.import_method == 'glance-download':
+        if not (args.remote_region and args.remote_image_id):
+            utils.exit("REMOTE GlANCE REGION and REMOTE IMAGE ID are "
+                       "required for glance-download import method. "
+                       "Please use --remote-region <region> and "
+                       "--remote-image-id <remote-image-id>.")
+        if args.uri:
+            utils.exit("You cannot specify a --uri with the glance-download "
+                       "import method.")
+        if file_name:
+            utils.exit("You cannot specify a --file with the glance-download "
+                       "import method.")
+        if using_stdin:
+            utils.exit("You cannot pass data via stdin with the "
+                       "glance-download import method.")
+
     # process
     image = gc.images.create(**fields)
     try:
@@ -330,12 +346,8 @@
 
 
 @utils.arg('id', metavar='<IMAGE_ID>', help=_('ID of image to update.'))
-@utils.schema_args(get_image_schema, omit=['id', 'locations', 'created_at',
-                                           'updated_at', 'file', 'checksum',
-                                           'virtual_size', 'size', 'status',
-                                           'schema', 'direct_url', 'tags',
-                                           'self', 'os_hidden',
-                                           'os_hash_value', 'os_hash_algo'])
+@utils.schema_args(get_image_schema, omit=['id', 'locations', 'tags',
+                                           'os_hidden'])
 # NOTE: --hidden requires special handling; see note at do_image_create
 @utils.arg('--hidden', type=strutils.bool_from_string, metavar='[True|False]',
            default=None,
@@ -726,6 +738,14 @@
                   '"image-stage".'))
 @utils.arg('--uri', metavar='<IMAGE_URL>', default=None,
            help=_('URI to download the external image.'))
+@utils.arg('--remote-region', metavar='<REMOTE_GLANCE_REGION>', default=None,
+           help=_('REMOTE GLANCE REGION to download the image.'))
+@utils.arg('--remote-image-id', metavar='<REMOTE_IMAGE_ID>', default=None,
+           help=_('The IMAGE ID of the image of remote glance, which needs'
+                  'to be imported with glance-download'))
+@utils.arg('--remote-service-interface', metavar='<REMOTE_SERVICE_INTERFACE>',
+           default='public',
+           help=_('The Remote Glance Service Interface for glance-download'))
 @utils.arg('id', metavar='<IMAGE_ID>',
            help=_('ID of image to import.'))
 @utils.arg('--store', metavar='<STORE>',
@@ -757,6 +777,10 @@
     stores = getattr(args, "stores", None)
     all_stores = getattr(args, "os_all_stores", None)
     allow_failure = getattr(args, "os_allow_failure", True)
+    uri = getattr(args, "uri", None)
+    remote_region = getattr(args, "remote-region", None)
+    remote_image_id = getattr(args, "remote-image-id", None)
+    remote_service_interface = getattr(args, "remote-service-interface", None)
 
     if not getattr(args, 'from_create', False):
         if (args.store and (stores or all_stores)) or (stores and all_stores):
@@ -800,6 +824,20 @@
         utils.exit("Import method should be 'web-download' if URI is "
                    "provided.")
 
+    if args.import_method == 'glance-download' and \
+            not (remote_region and remote_image_id):
+        utils.exit("Provide REMOTE_IMAGE_ID and remote-region for "
+                   "'glance-download' import method.")
+    if remote_region and args.import_method != 'glance-download':
+        utils.exit("Import method should be 'glance-download' if "
+                   "REMOTE REGION is provided.")
+    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 "
                    "'copy-image' import method.")
@@ -827,10 +865,12 @@
                        "an image with status 'active'.")
 
     # finally, do the import
-    gc.images.image_import(args.id, args.import_method, args.uri,
-                           backend=backend,
-                           stores=stores, all_stores=all_stores,
-                           allow_failure=allow_failure)
+    gc.images.image_import(args.id, args.import_method, uri=uri,
+                           remote_region=remote_region,
+                           remote_image_id=remote_image_id,
+                           remote_service_interface=remote_service_interface,
+                           backend=backend, stores=stores,
+                           all_stores=all_stores, allow_failure=allow_failure)
 
     image = gc.images.get(args.id)
     utils.print_image(image)
@@ -1053,8 +1093,7 @@
 @utils.schema_args(get_namespace_schema, omit=['property_count', 'properties',
                                                'tag_count', 'tags',
                                                'object_count', 'objects',
-                                               'resource_type_associations',
-                                               'schema'])
+                                               'resource_type_associations'])
 def do_md_namespace_update(gc, args):
     """Update an existing metadata definitions namespace."""
     schema = gc.schemas.get('metadefs/namespace')
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/python-glanceclient-4.0.0/python_glanceclient.egg-info/PKG-INFO 
new/python-glanceclient-4.2.0/python_glanceclient.egg-info/PKG-INFO
--- old/python-glanceclient-4.0.0/python_glanceclient.egg-info/PKG-INFO 
2022-05-20 22:34:28.000000000 +0200
+++ new/python-glanceclient-4.2.0/python_glanceclient.egg-info/PKG-INFO 
2022-11-16 14:50:20.000000000 +0100
@@ -1,6 +1,6 @@
 Metadata-Version: 1.2
 Name: python-glanceclient
-Version: 4.0.0
+Version: 4.2.0
 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.0.0/python_glanceclient.egg-info/SOURCES.txt 
new/python-glanceclient-4.2.0/python_glanceclient.egg-info/SOURCES.txt
--- old/python-glanceclient-4.0.0/python_glanceclient.egg-info/SOURCES.txt      
2022-05-20 22:34:28.000000000 +0200
+++ new/python-glanceclient-4.2.0/python_glanceclient.egg-info/SOURCES.txt      
2022-11-16 14:50:20.000000000 +0100
@@ -122,6 +122,7 @@
 releasenotes/notes/3.1.0_Release-1337ddc753b88905.yaml
 releasenotes/notes/3.6.0_Release-04d3b5017747290b.yaml
 releasenotes/notes/add-member-get-command-11c15e0a94ecd39a.yaml
+releasenotes/notes/add-support-for-glance-download-import-method-10525254db3e8e7a.yaml
 releasenotes/notes/bp-use-keystoneauth-e12f300e58577b13.yaml
 releasenotes/notes/check-for-md5-59db8fd67870b214.yaml
 releasenotes/notes/copy-existing-image-619b7e6bc3394446.yaml
@@ -163,6 +164,7 @@
 releasenotes/source/wallaby.rst
 releasenotes/source/xena.rst
 releasenotes/source/yoga.rst
+releasenotes/source/zed.rst
 releasenotes/source/_static/.placeholder
 releasenotes/source/_templates/.placeholder
 tools/fix_ca_bundle.sh
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/python-glanceclient-4.0.0/python_glanceclient.egg-info/pbr.json 
new/python-glanceclient-4.2.0/python_glanceclient.egg-info/pbr.json
--- old/python-glanceclient-4.0.0/python_glanceclient.egg-info/pbr.json 
2022-05-20 22:34:28.000000000 +0200
+++ new/python-glanceclient-4.2.0/python_glanceclient.egg-info/pbr.json 
2022-11-16 14:50:20.000000000 +0100
@@ -1 +1 @@
-{"git_version": "be8f394", "is_release": true}
\ No newline at end of file
+{"git_version": "f41f2c3", "is_release": true}
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/python-glanceclient-4.0.0/python_glanceclient.egg-info/requires.txt 
new/python-glanceclient-4.2.0/python_glanceclient.egg-info/requires.txt
--- old/python-glanceclient-4.0.0/python_glanceclient.egg-info/requires.txt     
2022-05-20 22:34:28.000000000 +0200
+++ new/python-glanceclient-4.2.0/python_glanceclient.egg-info/requires.txt     
2022-11-16 14:50:20.000000000 +0100
@@ -5,5 +5,5 @@
 pbr!=2.1.0,>=2.0.0
 pyOpenSSL>=17.1.0
 requests>=2.14.2
-warlock<2,>=1.2.0
+warlock>=1.2.0
 wrapt>=1.7.0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/python-glanceclient-4.0.0/releasenotes/notes/add-support-for-glance-download-import-method-10525254db3e8e7a.yaml
 
new/python-glanceclient-4.2.0/releasenotes/notes/add-support-for-glance-download-import-method-10525254db3e8e7a.yaml
--- 
old/python-glanceclient-4.0.0/releasenotes/notes/add-support-for-glance-download-import-method-10525254db3e8e7a.yaml
        1970-01-01 01:00:00.000000000 +0100
+++ 
new/python-glanceclient-4.2.0/releasenotes/notes/add-support-for-glance-download-import-method-10525254db3e8e7a.yaml
        2022-11-16 14:49:52.000000000 +0100
@@ -0,0 +1,5 @@
+---
+features:
+  - |
+    Add support for new ``glance-download`` image-import method to
+    import image from another glance/region in federated deployment.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/python-glanceclient-4.0.0/releasenotes/source/index.rst 
new/python-glanceclient-4.2.0/releasenotes/source/index.rst
--- old/python-glanceclient-4.0.0/releasenotes/source/index.rst 2022-05-20 
22:34:02.000000000 +0200
+++ new/python-glanceclient-4.2.0/releasenotes/source/index.rst 2022-11-16 
14:49:52.000000000 +0100
@@ -6,6 +6,7 @@
    :maxdepth: 1
 
    unreleased
+   zed
    yoga
    xena
    wallaby
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/python-glanceclient-4.0.0/releasenotes/source/zed.rst 
new/python-glanceclient-4.2.0/releasenotes/source/zed.rst
--- old/python-glanceclient-4.0.0/releasenotes/source/zed.rst   1970-01-01 
01:00:00.000000000 +0100
+++ new/python-glanceclient-4.2.0/releasenotes/source/zed.rst   2022-11-16 
14:49:52.000000000 +0100
@@ -0,0 +1,6 @@
+========================
+Zed Series Release Notes
+========================
+
+.. release-notes::
+   :branch: stable/zed
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/python-glanceclient-4.0.0/requirements.txt 
new/python-glanceclient-4.2.0/requirements.txt
--- old/python-glanceclient-4.0.0/requirements.txt      2022-05-20 
22:34:02.000000000 +0200
+++ new/python-glanceclient-4.2.0/requirements.txt      2022-11-16 
14:49:52.000000000 +0100
@@ -1,11 +1,8 @@
-# The order of packages is significant, because pip processes them in the order
-# of appearance. Changing the order has an impact on the overall integration
-# process, which may cause wedges in the gate later.
 pbr!=2.1.0,>=2.0.0 # Apache-2.0
 PrettyTable>=0.7.1 # BSD
 keystoneauth1>=3.6.2 # Apache-2.0
 requests>=2.14.2 # Apache-2.0
-warlock<2,>=1.2.0 # Apache-2.0
+warlock>=1.2.0 # Apache-2.0
 oslo.utils>=3.33.0 # Apache-2.0
 oslo.i18n>=3.15.3 # Apache-2.0
 wrapt>=1.7.0 # BSD License
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/python-glanceclient-4.0.0/test-requirements.txt 
new/python-glanceclient-4.2.0/test-requirements.txt
--- old/python-glanceclient-4.0.0/test-requirements.txt 2022-05-20 
22:34:02.000000000 +0200
+++ new/python-glanceclient-4.2.0/test-requirements.txt 2022-11-16 
14:49:52.000000000 +0100
@@ -1,9 +1,4 @@
-# The order of packages is significant, because pip processes them in the order
-# of appearance. Changing the order has an impact on the overall integration
-# process, which may cause wedges in the gate later.
-
 hacking>=3.0.1,<3.1.0 # Apache-2.0
-
 coverage!=4.4,>=4.0 # Apache-2.0
 os-client-config>=1.28.0 # Apache-2.0
 stestr>=2.0.0 # Apache-2.0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/python-glanceclient-4.0.0/tox.ini 
new/python-glanceclient-4.2.0/tox.ini
--- old/python-glanceclient-4.0.0/tox.ini       2022-05-20 22:34:02.000000000 
+0200
+++ new/python-glanceclient-4.2.0/tox.ini       2022-11-16 14:49:52.000000000 
+0100
@@ -1,12 +1,13 @@
 [tox]
 envlist = py39,pep8
-minversion = 2.0
+minversion = 3.18.0
 skipsdist = True
 
 [testenv]
 usedevelop = True
 setenv = OS_STDOUT_NOCAPTURE=False
          OS_STDERR_NOCAPTURE=False
+         PYTHONDONTWRITEBYTECODE=1
 
 # Nowadays, TOX_CONSTRAINTS_FILE should be used, but some older scripts might
 # still be using UPPER_CONSTRAINTS_FILE, so we check both variables and use the
@@ -35,7 +36,7 @@
 setenv =
   OS_TEST_PATH = ./glanceclient/tests/functional/v2
   OS_TESTENV_NAME = {envname}
-whitelist_externals =
+allowlist_externals =
     bash
 commands =
     bash tools/fix_ca_bundle.sh
@@ -56,6 +57,7 @@
 deps = -r{toxinidir}/doc/requirements.txt
 commands =
   sphinx-build -W -b html doc/source doc/build/html
+  sphinx-build -W -b man doc/source doc/build/man
 
 [testenv:releasenotes]
 basepython = python3

Reply via email to