Skip to content

Commit

Permalink
Fix URLs to use v3 when only v2 endpoint is listed in the catalog
Browse files Browse the repository at this point in the history
It covers the cases where we can authenticate with keystone v3 but the endpoint returned in the catalog is v2
see fog#492
  • Loading branch information
Anthony Chevalet committed Jul 20, 2020
1 parent 7911675 commit 21f8203
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/fog/openstack/core.rb
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,11 @@ def authenticate
@openstack_auth_url
end

# Manages cases where endpoint returned is v2 but v3 should be used
if @openstack_auth_url =~ /\/v3(\/)*$/ and @openstack_management_url !~ /\/v3(\/)*$/
@openstack_management_url = @openstack_auth_url
end

@current_user = token.user['name']
@current_user_id = token.user['id']
@current_tenant = token.tenant
Expand Down

0 comments on commit 21f8203

Please sign in to comment.