2929 "1" : "cinderclient.v1.client.Client" ,
3030 "2" : "cinderclient.v2.client.Client" ,
3131 "3" : "cinderclient.v3.client.Client" ,
32+ "3.42" : "cinderclient.v3.client.Client" ,
3233}
3334
3435
@@ -47,14 +48,19 @@ def make_client(instance):
4748 except Exception :
4849 del API_VERSIONS ['1' ]
4950
50- if instance ._api_version [API_NAME ] == '1' :
51+ version = instance ._api_version [API_NAME ]
52+ from cinderclient import api_versions
53+ # convert to APIVersion object
54+ version = api_versions .get_api_version (version )
55+
56+ if version .ver_major == '1' :
5157 # Monkey patch for v1 cinderclient
5258 volumes .Volume .NAME_ATTR = 'display_name'
5359 volume_snapshots .Snapshot .NAME_ATTR = 'display_name'
5460
5561 volume_client = utils .get_client_class (
5662 API_NAME ,
57- instance . _api_version [ API_NAME ] ,
63+ version . ver_major ,
5864 API_VERSIONS
5965 )
6066 LOG .debug ('Instantiating volume client: %s' , volume_client )
@@ -76,6 +82,7 @@ def make_client(instance):
7682 http_log_debug = http_log_debug ,
7783 region_name = instance .region_name ,
7884 endpoint_override = endpoint_override ,
85+ api_version = version ,
7986 ** kwargs
8087 )
8188
0 commit comments