Merge "Make providers use auth_url for authentication"

This commit is contained in:
Zuul 2018-08-11 15:09:50 +00:00 committed by Gerrit Code Review
commit f17ce9bd7e
2 changed files with 12 additions and 12 deletions

View File

@ -52,7 +52,7 @@ class Puppet::Provider::Cinder < Puppet::Provider::Openstack
end
def self.get_cinder_credentials
auth_keys = ['www_authenticate_uri', 'project_name', 'username',
auth_keys = ['auth_url', 'project_name', 'username',
'password']
conf = cinder_conf
if conf and conf['keystone_authtoken'] and
@ -82,7 +82,7 @@ class Puppet::Provider::Cinder < Puppet::Provider::Openstack
def self.get_auth_endpoint
q = cinder_credentials
"#{q['www_authenticate_uri']}"
"#{q['auth_url']}"
end
def self.auth_endpoint

View File

@ -24,19 +24,19 @@ describe Puppet::Provider::Cinder do
it 'should read conf file with all sections' do
creds_hash = {
'www_authenticate_uri' => 'https://192.168.56.210:5000/v2.0/',
'project_name' => 'admin_tenant',
'username' => 'admin',
'password' => 'password',
'project_domain_name' => 'Default',
'user_domain_name' => 'Default',
'auth_url' => 'https://192.168.56.210:5000/v2.0/',
'project_name' => 'admin_tenant',
'username' => 'admin',
'password' => 'password',
'project_domain_name' => 'Default',
'user_domain_name' => 'Default',
}
mock = {
'keystone_authtoken' => {
'www_authenticate_uri' => 'https://192.168.56.210:5000/v2.0/',
'project_name' => 'admin_tenant',
'username' => 'admin',
'password' => 'password',
'auth_url' => 'https://192.168.56.210:5000/v2.0/',
'project_name' => 'admin_tenant',
'username' => 'admin',
'password' => 'password',
}
}
Puppet::Util::IniConfig::File.expects(:new).returns(mock)