This repository was archived by the owner on Aug 1, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +2
-15
lines changed Expand file tree Collapse file tree 1 file changed +2
-15
lines changed Original file line number Diff line number Diff line change @@ -283,25 +283,12 @@ func NewBlockStorageV1(client *gophercloud.ProviderClient, eo gophercloud.Endpoi
283
283
284
284
// NewBlockStorageV2 creates a ServiceClient that may be used to access the v2 block storage service.
285
285
func NewBlockStorageV2 (client * gophercloud.ProviderClient , eo gophercloud.EndpointOpts ) (* gophercloud.ServiceClient , error ) {
286
- eo .ApplyDefaults ("volume " )
286
+ eo .ApplyDefaults ("volumev2 " )
287
287
url , err := client .EndpointLocator (eo )
288
288
if err != nil {
289
289
return nil , err
290
290
}
291
-
292
- // Force using v2 API
293
- if strings .Contains (url , "/v1" ) {
294
- url = strings .Replace (url , "/v1" , "/v2" , - 1 )
295
- }
296
- if ! strings .Contains (url , "/v2" ) {
297
- return nil , fmt .Errorf ("Block Storage v2 endpoint not found" )
298
- }
299
-
300
- return & gophercloud.ServiceClient {
301
- ProviderClient : client ,
302
- Endpoint : url ,
303
- ResourceBase : url ,
304
- }, nil
291
+ return & gophercloud.ServiceClient {ProviderClient : client , Endpoint : url }, nil
305
292
}
306
293
307
294
// NewCDNV1 creates a ServiceClient that may be used to access the OpenStack v1
You can’t perform that action at this time.
0 commit comments