diff -Nru python-glanceclient-2.15.0/AUTHORS python-glanceclient-2.16.0/AUTHORS --- python-glanceclient-2.15.0/AUTHORS 2018-12-10 15:34:39.000000000 +0000 +++ python-glanceclient-2.16.0/AUTHORS 2019-03-08 00:28:04.000000000 +0000 @@ -223,6 +223,7 @@ dineshbhor eddie-sheffield haobing1 +huang.zhiping iccha-sethi iccha.sethi imacdonn @@ -245,6 +246,7 @@ shu-mutou sonu.kumar sridhargaddam +sunjia venkatamahesh wanghong wangqi diff -Nru python-glanceclient-2.15.0/ChangeLog python-glanceclient-2.16.0/ChangeLog --- python-glanceclient-2.15.0/ChangeLog 2018-12-10 15:34:39.000000000 +0000 +++ python-glanceclient-2.16.0/ChangeLog 2019-03-08 00:28:04.000000000 +0000 @@ -1,11 +1,24 @@ CHANGES ======= +2.16.0 +------ + +* Release notes for 2.16.0 +* Remove redundant information from error message +* Update min tox version to 2.0 +* Update irrelevant-files for dsvm-functional tests +* add python 3.7 unit test job +* Add image-list filter for multihash +* Change openstack-dev to openstack-discuss +* Add Python 3.6 classifier to setup.cfg + 2.15.0 ------ * Show the backend store info * Don't quote colon in HTTP headers +* Embed validation data when adding location 2.14.0 ------ diff -Nru python-glanceclient-2.15.0/debian/changelog python-glanceclient-2.16.0/debian/changelog --- python-glanceclient-2.15.0/debian/changelog 2019-03-14 21:22:35.000000000 +0000 +++ python-glanceclient-2.16.0/debian/changelog 2019-03-22 16:23:56.000000000 +0000 @@ -1,8 +1,14 @@ -python-glanceclient (1:2.15.0-0ubuntu1~cloud0) bionic-stein; urgency=medium +python-glanceclient (1:2.16.0-0ubuntu1~cloud0) bionic-stein; urgency=medium * New upstream release for the Ubuntu Cloud Archive. - -- Openstack Ubuntu Testing Bot Thu, 14 Mar 2019 21:22:35 +0000 + -- Openstack Ubuntu Testing Bot Fri, 22 Mar 2019 16:23:56 +0000 + +python-glanceclient (1:2.16.0-0ubuntu1) disco; urgency=medium + + * New upstream release for OpenStack Stein. + + -- James Page Fri, 22 Mar 2019 14:30:31 +0000 python-glanceclient (1:2.15.0-0ubuntu1) disco; urgency=medium diff -Nru python-glanceclient-2.15.0/glanceclient/exc.py python-glanceclient-2.16.0/glanceclient/exc.py --- python-glanceclient-2.15.0/glanceclient/exc.py 2018-12-10 15:32:40.000000000 +0000 +++ python-glanceclient-2.16.0/glanceclient/exc.py 2019-03-08 00:26:17.000000000 +0000 @@ -52,7 +52,7 @@ self.details = details or self.__class__.__name__ def __str__(self): - return "%s (HTTP %s)" % (self.details, self.code) + return "HTTP %s" % (self.details) class HTTPMultipleChoices(HTTPException): diff -Nru python-glanceclient-2.15.0/glanceclient/tests/unit/v2/test_images.py python-glanceclient-2.16.0/glanceclient/tests/unit/v2/test_images.py --- python-glanceclient-2.15.0/glanceclient/tests/unit/v2/test_images.py 2018-12-10 15:32:40.000000000 +0000 +++ python-glanceclient-2.16.0/glanceclient/tests/unit/v2/test_images.py 2019-03-08 00:26:17.000000000 +0000 @@ -26,6 +26,10 @@ _CHKSUM = '93264c3edf5972c9f1cb309543d38a5c' _CHKSUM1 = '54264c3edf5972c9f1cb309453d38a46' +_HASHVAL = '54264c3edf93264c3edf5972c9f1cb309543d38a5c5972c9f1cb309453d38a46' +_HASHVAL1 = 'cb309543d38a5c5972c9f1cb309453d38a4654264c3edf93264c3edf5972c9f1' +_HASHBAD = '93264c3edf597254264c3edf5972c9f1cb309453d38a46c9f1cb309543d38a5c' + _TAG1 = 'power' _TAG2 = '64bit' @@ -457,6 +461,41 @@ {'images': []}, ), }, + '/v2/images?limit=%d&os_hash_value=%s' % (images.DEFAULT_PAGE_SIZE, + _HASHVAL): { + 'GET': ( + {}, + {'images': [ + { + 'id': '3a4560a1-e585-443e-9b39-553b46ec92d1', + 'name': 'image-1', + } + ]}, + ), + }, + '/v2/images?limit=%d&os_hash_value=%s' % (images.DEFAULT_PAGE_SIZE, + _HASHVAL1): { + 'GET': ( + {}, + {'images': [ + { + 'id': '2a4560b2-e585-443e-9b39-553b46ec92d1', + 'name': 'image-1', + }, + { + 'id': '6f99bf80-2ee6-47cf-acfe-1f1fabb7e810', + 'name': 'image-2', + }, + ]}, + ), + }, + '/v2/images?limit=%d&os_hash_value=%s' % (images.DEFAULT_PAGE_SIZE, + _HASHBAD): { + 'GET': ( + {}, + {'images': []}, + ), + }, '/v2/images?limit=%d&tag=%s' % (images.DEFAULT_PAGE_SIZE, _TAG1): { 'GET': ( {}, @@ -754,6 +793,27 @@ images = self.controller.list(**filters) self.assertEqual(0, len(images)) + def test_list_images_for_hash_single_image(self): + fake_id = '3a4560a1-e585-443e-9b39-553b46ec92d1' + filters = {'filters': {'os_hash_value': _HASHVAL}} + images = self.controller.list(**filters) + self.assertEqual(1, len(images)) + self.assertEqual('%s' % fake_id, images[0].id) + + def test_list_images_for_hash_multiple_images(self): + fake_id1 = '2a4560b2-e585-443e-9b39-553b46ec92d1' + fake_id2 = '6f99bf80-2ee6-47cf-acfe-1f1fabb7e810' + filters = {'filters': {'os_hash_value': _HASHVAL1}} + images = self.controller.list(**filters) + self.assertEqual(2, len(images)) + self.assertEqual('%s' % fake_id1, images[0].id) + self.assertEqual('%s' % fake_id2, images[1].id) + + def test_list_images_for_wrong_hash(self): + filters = {'filters': {'os_hash_value': _HASHBAD}} + images = self.controller.list(**filters) + self.assertEqual(0, len(images)) + def test_list_images_for_bogus_owner(self): filters = {'filters': {'owner': _BOGUS_ID}} images = self.controller.list(**filters) diff -Nru python-glanceclient-2.15.0/glanceclient/tests/unit/v2/test_shell_v2.py python-glanceclient-2.16.0/glanceclient/tests/unit/v2/test_shell_v2.py --- python-glanceclient-2.15.0/glanceclient/tests/unit/v2/test_shell_v2.py 2018-12-10 15:32:40.000000000 +0000 +++ python-glanceclient-2.16.0/glanceclient/tests/unit/v2/test_shell_v2.py 2019-03-08 00:26:21.000000000 +0000 @@ -265,6 +265,7 @@ 'sort': None, 'verbose': False, 'include_stores': False, + 'os_hash_value': None, 'os_hidden': False } args = self._make_args(input) @@ -302,6 +303,7 @@ 'sort': None, 'verbose': True, 'include_stores': False, + 'os_hash_value': None, 'os_hidden': False } args = self._make_args(input) @@ -328,6 +330,7 @@ 'sort': None, 'verbose': False, 'include_stores': True, + 'os_hash_value': None, 'os_hidden': False } args = self._make_args(input) @@ -353,6 +356,7 @@ 'sort': None, 'verbose': True, 'include_stores': True, + 'os_hash_value': None, 'os_hidden': False } args = self._make_args(input) @@ -379,6 +383,7 @@ 'sort': None, 'verbose': False, 'include_stores': False, + 'os_hash_value': None, 'os_hidden': True } args = self._make_args(input) @@ -416,6 +421,7 @@ 'sort': None, 'verbose': False, 'include_stores': False, + 'os_hash_value': None, 'os_hidden': False } args = self._make_args(input) @@ -453,6 +459,7 @@ 'sort_dir': [], 'verbose': False, 'include_stores': False, + 'os_hash_value': None, 'os_hidden': False } args = self._make_args(input) @@ -490,6 +497,7 @@ 'sort': None, 'verbose': False, 'include_stores': False, + 'os_hash_value': None, 'os_hidden': False } args = self._make_args(input) @@ -1510,18 +1518,25 @@ def test_do_location_add(self): gc = self.gc - loc = {'url': 'http://foo.com/', 'metadata': {'foo': 'bar'}} - args = self._make_args({'id': 'pass', - 'url': loc['url'], - 'metadata': json.dumps(loc['metadata'])}) + loc = {'url': 'http://foo.com/', + 'metadata': {'foo': 'bar'}, + 'validation_data': {'checksum': 'csum', + 'os_hash_algo': 'algo', + 'os_hash_value': 'value'}} + args = {'id': 'pass', + 'url': loc['url'], + 'metadata': json.dumps(loc['metadata']), + 'checksum': 'csum', + 'hash_algo': 'algo', + 'hash_value': 'value'} with mock.patch.object(gc.images, 'add_location') as mocked_addloc: expect_image = {'id': 'pass', 'locations': [loc]} mocked_addloc.return_value = expect_image - test_shell.do_location_add(self.gc, args) - mocked_addloc.assert_called_once_with('pass', - loc['url'], - loc['metadata']) + test_shell.do_location_add(self.gc, self._make_args(args)) + mocked_addloc.assert_called_once_with( + 'pass', loc['url'], loc['metadata'], + validation_data=loc['validation_data']) utils.print_dict.assert_called_once_with(expect_image) def test_do_location_delete(self): diff -Nru python-glanceclient-2.15.0/glanceclient/v2/images.py python-glanceclient-2.16.0/glanceclient/v2/images.py --- python-glanceclient-2.15.0/glanceclient/v2/images.py 2018-12-10 15:32:40.000000000 +0000 +++ python-glanceclient-2.16.0/glanceclient/v2/images.py 2019-03-08 00:26:21.000000000 +0000 @@ -432,7 +432,7 @@ data=json.dumps(patch_body)) return (resp, body), resp - def add_location(self, image_id, url, metadata): + def add_location(self, image_id, url, metadata, validation_data=None): """Add a new location entry to an image's list of locations. It is an error to add a URL that is already present in the list of @@ -441,10 +441,13 @@ :param image_id: ID of image to which the location is to be added. :param url: URL of the location to add. :param metadata: Metadata associated with the location. + :param validation_data: Validation data for the image. :returns: The updated image """ add_patch = [{'op': 'add', 'path': '/locations/-', 'value': {'url': url, 'metadata': metadata}}] + if validation_data: + add_patch[0]['value']['validation_data'] = validation_data response = self._send_image_update_request(image_id, add_patch) # Get request id from the above update request and pass the same to # following get request diff -Nru python-glanceclient-2.15.0/glanceclient/v2/shell.py python-glanceclient-2.16.0/glanceclient/v2/shell.py --- python-glanceclient-2.15.0/glanceclient/v2/shell.py 2018-12-10 15:32:40.000000000 +0000 +++ python-glanceclient-2.16.0/glanceclient/v2/shell.py 2019-03-08 00:26:21.000000000 +0000 @@ -327,6 +327,9 @@ action='append', dest='properties', default=[]) @utils.arg('--checksum', metavar='', help=_('Displays images that match the MD5 checksum.')) +@utils.arg('--hash', dest='os_hash_value', default=None, + metavar='', + help=_('Displays images that match the specified hash value.')) @utils.arg('--tag', metavar='', action='append', help=_("Filter images by a user-defined tag.")) @utils.arg('--sort-key', default=[], action='append', @@ -358,7 +361,7 @@ def do_image_list(gc, args): """List images you can access.""" filter_keys = ['visibility', 'member_status', 'owner', 'checksum', 'tag', - 'os_hidden'] + 'os_hidden', 'os_hash_value'] filter_items = [(key, getattr(args, key)) for key in filter_keys] if args.properties: @@ -747,16 +750,30 @@ @utils.arg('--metadata', metavar='', default='{}', help=_('Metadata associated with the location. ' 'Must be a valid JSON object (default: %(default)s)')) +@utils.arg('--checksum', metavar='', + help=_('md5 checksum of image contents')) +@utils.arg('--hash-algo', metavar='', + help=_('Multihash algorithm')) +@utils.arg('--hash-value', metavar='', + help=_('Multihash value')) @utils.arg('id', metavar='', help=_('ID of image to which the location is to be added.')) def do_location_add(gc, args): """Add a location (and related metadata) to an image.""" + validation_data = {} + if args.checksum: + validation_data['checksum'] = args.checksum + if args.hash_algo: + validation_data['os_hash_algo'] = args.hash_algo + if args.hash_value: + validation_data['os_hash_value'] = args.hash_value try: metadata = json.loads(args.metadata) except ValueError: utils.exit('Metadata is not a valid JSON object.') else: - image = gc.images.add_location(args.id, args.url, metadata) + image = gc.images.add_location(args.id, args.url, metadata, + validation_data=validation_data) utils.print_dict(image) diff -Nru python-glanceclient-2.15.0/PKG-INFO python-glanceclient-2.16.0/PKG-INFO --- python-glanceclient-2.15.0/PKG-INFO 2018-12-10 15:34:39.000000000 +0000 +++ python-glanceclient-2.16.0/PKG-INFO 2019-03-08 00:28:04.000000000 +0000 @@ -1,10 +1,10 @@ Metadata-Version: 1.1 Name: python-glanceclient -Version: 2.15.0 +Version: 2.16.0 Summary: OpenStack Image API Client Library Home-page: https://docs.openstack.org/python-glanceclient/latest/ Author: OpenStack -Author-email: openstack-dev@lists.openstack.org +Author-email: openstack-discuss@lists.openstack.org License: Apache License, Version 2.0 Description: ======================== Team and repository tags @@ -72,3 +72,4 @@ Classifier: Programming Language :: Python :: 2.7 Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3.5 +Classifier: Programming Language :: Python :: 3.6 diff -Nru python-glanceclient-2.15.0/python_glanceclient.egg-info/pbr.json python-glanceclient-2.16.0/python_glanceclient.egg-info/pbr.json --- python-glanceclient-2.15.0/python_glanceclient.egg-info/pbr.json 2018-12-10 15:34:39.000000000 +0000 +++ python-glanceclient-2.16.0/python_glanceclient.egg-info/pbr.json 2019-03-08 00:28:04.000000000 +0000 @@ -1 +1 @@ -{"git_version": "c4c92ec", "is_release": true} \ No newline at end of file +{"git_version": "44a4dbd", "is_release": true} \ No newline at end of file diff -Nru python-glanceclient-2.15.0/python_glanceclient.egg-info/PKG-INFO python-glanceclient-2.16.0/python_glanceclient.egg-info/PKG-INFO --- python-glanceclient-2.15.0/python_glanceclient.egg-info/PKG-INFO 2018-12-10 15:34:39.000000000 +0000 +++ python-glanceclient-2.16.0/python_glanceclient.egg-info/PKG-INFO 2019-03-08 00:28:04.000000000 +0000 @@ -1,10 +1,10 @@ Metadata-Version: 1.1 Name: python-glanceclient -Version: 2.15.0 +Version: 2.16.0 Summary: OpenStack Image API Client Library Home-page: https://docs.openstack.org/python-glanceclient/latest/ Author: OpenStack -Author-email: openstack-dev@lists.openstack.org +Author-email: openstack-discuss@lists.openstack.org License: Apache License, Version 2.0 Description: ======================== Team and repository tags @@ -72,3 +72,4 @@ Classifier: Programming Language :: Python :: 2.7 Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3.5 +Classifier: Programming Language :: Python :: 3.6 diff -Nru python-glanceclient-2.15.0/python_glanceclient.egg-info/SOURCES.txt python-glanceclient-2.16.0/python_glanceclient.egg-info/SOURCES.txt --- python-glanceclient-2.15.0/python_glanceclient.egg-info/SOURCES.txt 2018-12-10 15:34:39.000000000 +0000 +++ python-glanceclient-2.16.0/python_glanceclient.egg-info/SOURCES.txt 2019-03-08 00:28:04.000000000 +0000 @@ -114,6 +114,7 @@ python_glanceclient.egg-info/requires.txt python_glanceclient.egg-info/top_level.txt releasenotes/notes/.placeholder +releasenotes/notes/2.16.0_Release-43ebe06b74a272ba.yaml releasenotes/notes/bp-use-keystoneauth-e12f300e58577b13.yaml releasenotes/notes/headers-encoding-bug-rocky-889ccd885a9cc4e8.yaml releasenotes/notes/hidden-images-support-9e2277ad62bf0d31.yaml @@ -121,11 +122,13 @@ releasenotes/notes/log-request-id-e7f67a23a0ed5c7b.yaml releasenotes/notes/multi-store-support-acc7ad0e7e8b6f99.yaml releasenotes/notes/multihash-download-verification-596e91bf7b68e7db.yaml +releasenotes/notes/multihash-filter-ef2a48dc48fae9dc.yaml releasenotes/notes/multihash-support-f1474590cf3ef5cf.yaml releasenotes/notes/pike-relnote-2c77b01aa8799f35.yaml releasenotes/notes/return-request-id-to-caller-47f4c0a684b1d88e.yaml releasenotes/notes/rm-deprecate-ssl-opts-c88225a4ba2285ad.yaml releasenotes/notes/rocky-2.11.0-ba936fd5e969198d.yaml +releasenotes/notes/validation-data-support-dfb2463914818cd2.yaml releasenotes/source/conf.py releasenotes/source/earlier.rst releasenotes/source/index.rst diff -Nru python-glanceclient-2.15.0/releasenotes/notes/2.16.0_Release-43ebe06b74a272ba.yaml python-glanceclient-2.16.0/releasenotes/notes/2.16.0_Release-43ebe06b74a272ba.yaml --- python-glanceclient-2.15.0/releasenotes/notes/2.16.0_Release-43ebe06b74a272ba.yaml 1970-01-01 00:00:00.000000000 +0000 +++ python-glanceclient-2.16.0/releasenotes/notes/2.16.0_Release-43ebe06b74a272ba.yaml 2019-03-08 00:26:21.000000000 +0000 @@ -0,0 +1,12 @@ +--- +prelude: > + This version of python-glanceclient adds Python 3.6 classifier and gating + on Python 3.7 environment. +fixes: + - | + * Bug 1788271_: Add image-list filter for multihash + * Bug 1598714_: Remove redundant information from error message + + .. _1788271: https://code.launchpad.net/bugs/1788271 + .. _1598714: https://code.launchpad.net/bugs/1598714 + diff -Nru python-glanceclient-2.15.0/releasenotes/notes/multihash-filter-ef2a48dc48fae9dc.yaml python-glanceclient-2.16.0/releasenotes/notes/multihash-filter-ef2a48dc48fae9dc.yaml --- python-glanceclient-2.15.0/releasenotes/notes/multihash-filter-ef2a48dc48fae9dc.yaml 1970-01-01 00:00:00.000000000 +0000 +++ python-glanceclient-2.16.0/releasenotes/notes/multihash-filter-ef2a48dc48fae9dc.yaml 2019-03-08 00:26:17.000000000 +0000 @@ -0,0 +1,13 @@ +--- +features: + - | + For parity with the old ``checksum`` field, this release adds the + ability for CLI users to filter the image list based upon a particular + multihash value using the ``--hash `` option. Issue the + command: + + .. code-block:: none + + glance help image-list + + for more information. diff -Nru python-glanceclient-2.15.0/releasenotes/notes/validation-data-support-dfb2463914818cd2.yaml python-glanceclient-2.16.0/releasenotes/notes/validation-data-support-dfb2463914818cd2.yaml --- python-glanceclient-2.15.0/releasenotes/notes/validation-data-support-dfb2463914818cd2.yaml 1970-01-01 00:00:00.000000000 +0000 +++ python-glanceclient-2.16.0/releasenotes/notes/validation-data-support-dfb2463914818cd2.yaml 2019-03-08 00:26:21.000000000 +0000 @@ -0,0 +1,12 @@ +--- +features: + - | + Support for embedding validation data (checksum and multihash) when adding + a location to an image. Requires the Stein release server-side. + + The ``glance.images.add_location()`` method now accepts an optional + argument ``validation_data``, in the form of a dictionary containing + ``checksum``, ``os_hash_algo`` and ``os_hash_value``. + + The ``location-add`` command now accepts optional arguments ``--checksum``, + ``--hash-algo`` and ``--hash-value``. diff -Nru python-glanceclient-2.15.0/setup.cfg python-glanceclient-2.16.0/setup.cfg --- python-glanceclient-2.15.0/setup.cfg 2018-12-10 15:34:39.000000000 +0000 +++ python-glanceclient-2.16.0/setup.cfg 2019-03-08 00:28:04.000000000 +0000 @@ -5,7 +5,7 @@ README.rst license = Apache License, Version 2.0 author = OpenStack -author-email = openstack-dev@lists.openstack.org +author-email = openstack-discuss@lists.openstack.org home-page = https://docs.openstack.org/python-glanceclient/latest/ classifier = Development Status :: 5 - Production/Stable @@ -20,6 +20,7 @@ Programming Language :: Python :: 2.7 Programming Language :: Python :: 3 Programming Language :: Python :: 3.5 + Programming Language :: Python :: 3.6 [files] packages = diff -Nru python-glanceclient-2.15.0/tox.ini python-glanceclient-2.16.0/tox.ini --- python-glanceclient-2.15.0/tox.ini 2018-12-10 15:32:40.000000000 +0000 +++ python-glanceclient-2.16.0/tox.ini 2019-03-08 00:26:17.000000000 +0000 @@ -1,6 +1,6 @@ [tox] envlist = py35,py27,pep8 -minversion = 1.6 +minversion = 2.0 skipsdist = True [testenv] diff -Nru python-glanceclient-2.15.0/.zuul.yaml python-glanceclient-2.16.0/.zuul.yaml --- python-glanceclient-2.15.0/.zuul.yaml 2018-12-10 15:32:40.000000000 +0000 +++ python-glanceclient-2.16.0/.zuul.yaml 2019-03-08 00:26:17.000000000 +0000 @@ -36,6 +36,15 @@ s-proxy: true # Hardcode glanceclient path so the job can be run on glance patches zuul_work_dir: src/git.openstack.org/openstack/python-glanceclient + irrelevant-files: + - ^doc/.*$ + - ^releasenotes/.*$ + - ^.*\.rst$ + - ^(test-|)requirements.txt$ + - ^lower-constraints.txt$ + - ^setup.cfg$ + - ^tox.ini$ + - ^\.zuul\.yaml$ - job: name: glanceclient-dsvm-functional @@ -66,6 +75,15 @@ s-proxy: true # Hardcode glanceclient path so the job can be run on glance patches zuul_work_dir: src/git.openstack.org/openstack/python-glanceclient + irrelevant-files: + - ^doc/.*$ + - ^releasenotes/.*$ + - ^.*\.rst$ + - ^(test-|)requirements.txt$ + - ^lower-constraints.txt$ + - ^setup.cfg$ + - ^tox.ini$ + - ^\.zuul\.yaml$ - job: name: glanceclient-tox-keystone-tips-base @@ -133,6 +151,7 @@ - openstack-python-jobs - openstack-python35-jobs - openstack-python36-jobs + - openstack-python37-jobs - publish-openstack-docs-pti - release-notes-jobs-python3 check: