Skip to content

Commit b019a56

Browse files
committed
Add check for cinderclient.v2 support
Block Storage API v2 support is being removed from the cinderclient during the Xena development cycle [0], so add a check to determine whether the available cinderclient has v2 support. [0] https://wiki.openstack.org/wiki/CinderXenaPTGSummary#Removing_the_Block_Storage_API_v2 Change-Id: Id54da1704d94526071f500c36a6e38d6d84aa7b8
1 parent 6bdf030 commit b019a56

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

openstackclient/volume/client.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,15 @@ def make_client(instance):
4242
from cinderclient.v3 import volume_snapshots
4343
from cinderclient.v3 import volumes
4444

45-
# Try a small import to check if cinderclient v1 is supported
45+
# Check whether the available cinderclient supports v1 or v2
4646
try:
4747
from cinderclient.v1 import services # noqa
4848
except Exception:
4949
del API_VERSIONS['1']
50+
try:
51+
from cinderclient.v2 import services # noqa
52+
except Exception:
53+
del API_VERSIONS['2']
5054

5155
version = instance._api_version[API_NAME]
5256
from cinderclient import api_versions

0 commit comments

Comments
 (0)