Skip to content

Commit 124181c

Browse files
author
Anthony Chevalet
committed
Fix URLs to use v3 when only v2 endpoint is listed in the catalog
It covers the cases where we can authenticate with keystone v3 but the endpoint returned in the catalog is v2 see #492
1 parent 7911675 commit 124181c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/fog/openstack/core.rb

+5
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,11 @@ def authenticate
222222
@openstack_auth_url
223223
end
224224

225+
# Manages cases where identity endpoint returned is v2 but v3 should be used
226+
if @openstack_service_type.include? 'identity_v3' and @openstack_management_url =~ /\/v2.0(\/)*$/
227+
@openstack_management_url = @openstack_auth_url
228+
end
229+
225230
@current_user = token.user['name']
226231
@current_user_id = token.user['id']
227232
@current_tenant = token.tenant

0 commit comments

Comments
 (0)