From c05e17a0e9f9273c2e0107263eeb67b3ac3aecdb Mon Sep 17 00:00:00 2001 From: Mridula Joshi <mrjoshi@redhat.com> Date: Thu, 18 May 2023 11:36:50 +0000 Subject: [PATCH] image: Fixed URL for stores_info Updated the ``stores()`` by updating base-path for stores-info detail. It should be ``info/stores/detail Change-Id: If436e58d410e2b2670415ef962b5a7758103970b --- openstack/image/v2/_proxy.py | 2 +- openstack/image/v2/service_info.py | 2 ++ openstack/tests/unit/image/v2/test_service_info.py | 6 ++++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/openstack/image/v2/_proxy.py b/openstack/image/v2/_proxy.py index 448778311..8dfbf21a9 100644 --- a/openstack/image/v2/_proxy.py +++ b/openstack/image/v2/_proxy.py @@ -1615,7 +1615,7 @@ class Proxy(proxy.Proxy): :rtype: :class:`~openstack.image.v2.service_info.Store` """ if details: - query['base_path'] = utils.urljoin(_si.Store, 'details') + query['base_path'] = utils.urljoin(_si.Store.base_path, 'detail') return self._list(_si.Store, **query) # ====== IMPORTS ====== diff --git a/openstack/image/v2/service_info.py b/openstack/image/v2/service_info.py index 15023b028..1b27b5143 100644 --- a/openstack/image/v2/service_info.py +++ b/openstack/image/v2/service_info.py @@ -36,6 +36,8 @@ class Store(resource.Resource): description = resource.Body('description') #: default is_default = resource.Body('default', type=bool) + #: properties + properties = resource.Body('properties', type=dict) def delete_image(self, session, image, *, ignore_missing=False): """Delete image from store diff --git a/openstack/tests/unit/image/v2/test_service_info.py b/openstack/tests/unit/image/v2/test_service_info.py index 92c53c3f3..b9d354218 100644 --- a/openstack/tests/unit/image/v2/test_service_info.py +++ b/openstack/tests/unit/image/v2/test_service_info.py @@ -29,6 +29,11 @@ EXAMPLE_STORE = { 'id': IDENTIFIER, 'description': 'Fast access to rbd store', 'default': True, + 'properties': { + "pool": "pool1", + "chunk_size": 65536, + "thin_provisioning": False, + }, } @@ -49,6 +54,7 @@ class TestStore(base.TestCase): self.assertEqual(EXAMPLE_STORE['id'], sot.id) self.assertEqual(EXAMPLE_STORE['description'], sot.description) self.assertEqual(EXAMPLE_STORE['default'], sot.is_default) + self.assertEqual(EXAMPLE_STORE['properties'], sot.properties) @mock.patch.object(exceptions, 'raise_from_response', mock.Mock()) def test_delete_image(self):