commit c6570d704947e56c391bd218edf0b2a74aa67233 Author: Mark Chappell Date: Thu Oct 8 09:28:19 2020 +0200 Add "description" to cinder volume types. As per: https://docs.openstack.org/api-ref/block-storage/v3/index.html?expanded=show-volume-type-detail-detail#show-volume-type-detail Volume Types also have a 'description' attribute Change-Id: I0f822aa6291c42161e01bc989363daaade5a9f53 diff --git a/openstack/block_storage/v3/type.py b/openstack/block_storage/v3/type.py index 7e3c81a..c26f25d 100644 --- a/openstack/block_storage/v3/type.py +++ b/openstack/block_storage/v3/type.py @@ -31,6 +31,8 @@ class Type(resource.Resource): id = resource.Body("id") #: Name of the type. name = resource.Body("name") + #: Description of the type. + description = resource.Body("description") #: A dict of extra specifications. "capabilities" is a usual key. extra_specs = resource.Body("extra_specs", type=dict) #: a private volume-type. *Type: bool* diff --git a/openstack/tests/unit/block_storage/v3/test_type.py b/openstack/tests/unit/block_storage/v3/test_type.py index 5bdcff1..547effc 100644 --- a/openstack/tests/unit/block_storage/v3/test_type.py +++ b/openstack/tests/unit/block_storage/v3/test_type.py @@ -20,7 +20,8 @@ TYPE = { "capabilities": "gpu" }, "id": FAKE_ID, - "name": "SSD" + "name": "SSD", + "description": "Test type", } @@ -46,3 +47,4 @@ class TestType(base.TestCase): self.assertEqual(TYPE["id"], sot.id) self.assertEqual(TYPE["extra_specs"], sot.extra_specs) self.assertEqual(TYPE["name"], sot.name) + self.assertEqual(TYPE["description"], sot.description)