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
283283
284284// NewBlockStorageV2 creates a ServiceClient that may be used to access the v2 block storage service.
285285func NewBlockStorageV2 (client * gophercloud.ProviderClient , eo gophercloud.EndpointOpts ) (* gophercloud.ServiceClient , error ) {
286- eo .ApplyDefaults ("volume " )
286+ eo .ApplyDefaults ("volumev2 " )
287287 url , err := client .EndpointLocator (eo )
288288 if err != nil {
289289 return nil , err
290290 }
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
305292}
306293
307294// 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