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
This commit is contained in:
Mridula Joshi 2023-05-18 11:36:50 +00:00
parent 18fbd8c739
commit c05e17a0e9
3 changed files with 9 additions and 1 deletions

View File

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

View File

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

View File

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