From cc1722be748c607d70b6cd0c3fb28550472d3f64 Mon Sep 17 00:00:00 2001 From: Anthony Chevalet Date: Mon, 20 Jul 2020 12:19:40 +0200 Subject: [PATCH] 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 https://github.com/fog/fog-openstack/issues/492 --- lib/fog/openstack/core.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/fog/openstack/core.rb b/lib/fog/openstack/core.rb index 86090e9b..64e9080d 100644 --- a/lib/fog/openstack/core.rb +++ b/lib/fog/openstack/core.rb @@ -222,6 +222,11 @@ def authenticate @openstack_auth_url end + # Manages cases where identity endpoint returned is v2 but v3 should be used + if @openstack_service_type.include? 'identity_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