Skip to content

Commit c6946f4

Browse files
committed
clientmanager: Check for 'block-storage' service type
This is a fun one driven by two separate changes. We recently started checking whether the volume service was available before setting quotas in order to allow us to use quota set for other services [1]. This merged a number of weeks ago and was included in 7.1.0. More recently, we modified DevStack to stop publishing a service catalog entry with a service type of 'volumev3', preferring instead to use the correct 'block-storage' service type. Taken separately, neither of these changes would have caused issues. Together, they mean our lookups for the volume service now fail and we can't set volume quotas. Fix things by checking for the block-storage service type also. A future change will raise a warning (later an error) if the volume service is not found and you're attempting to set a quota since this is clearly a mistake. Change-Id: Ibbeef52225e18757cd28d0fbfb14c1ca06975b60 Signed-off-by: Stephen Finucane <stephenfin@redhat.com> Closes-bug: #2084580 (cherry picked from commit 7c6b47b)
1 parent a1ddfa4 commit c6946f4

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

openstackclient/common/clientmanager.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,15 @@ def is_compute_endpoint_enabled(self):
129129
# TODO(stephenfin): Drop volume_client argument in OSC 8.0 or later.
130130
def is_volume_endpoint_enabled(self, volume_client=None):
131131
"""Check if volume endpoint is enabled"""
132+
# We check against the service type and all aliases defined by the
133+
# Service Types Authority
134+
# https://service-types.openstack.org/service-types.json
132135
return (
133-
self.is_service_available('volume') is not False
136+
self.is_service_available('block-storage') is not False
137+
or self.is_service_available('volume') is not False
134138
or self.is_service_available('volumev3') is not False
135139
or self.is_service_available('volumev2') is not False
140+
or self.is_service_available('block-store') is not False
136141
)
137142

138143

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
fixes:
3+
- |
4+
The ``quota set`` and ``limits show`` commands will now check for the
5+
``block-storage`` and ``block-store`` service types along with ``volume``,
6+
``volumev2`` and ``volumev3``.
7+
8+
[Bug `2084580 <https://bugs.launchpad.net/python-openstackclient/+bug/2084580>`_]

0 commit comments

Comments
 (0)