Switch trove auth provider to keystone v3

Currently, trove auth provider has been implicitely using
keystone v2.0 by not declaring DOMAIN variables.
Now, api v2.0 is being deprecated and we need to use API v3.

Change-Id: Id2ed9ce08199d95e9438918ffda3417a1ee085f2
This commit is contained in:
Alfredo Moralejo 2017-10-16 16:26:35 +02:00
parent a54b81c779
commit e156c4136f

View File

@ -26,7 +26,8 @@ class Puppet::Provider::Trove < Puppet::Provider
end
def self.get_trove_credentials
auth_keys = ['auth_uri', 'project_name', 'username', 'password']
auth_keys = ['auth_uri', 'project_name', 'username', 'password',
'project_domain_name', 'user_domain_name']
conf = trove_conf
if conf and conf['keystone_authtoken'] and
auth_keys.all?{|k| !conf['keystone_authtoken'][k].nil?}
@ -53,10 +54,12 @@ correctly configured.")
def self.auth_trove(*args)
q = trove_credentials
authenv = {
:OS_AUTH_URL => q['auth_uri'],
:OS_USERNAME => q['username'],
:OS_PROJECT_NAME => q['project_name'],
:OS_PASSWORD => q['password']
:OS_AUTH_URL => q['auth_uri'],
:OS_USERNAME => q['username'],
:OS_PROJECT_NAME => q['project_name'],
:OS_PASSWORD => q['password'],
:OS_PROJECT_DOMAIN_NAME => q['project_domain_name'],
:OS_USER_DOMAIN_NAME => q['user_domain_name']
}
begin
withenv authenv do