Make providers use auth_url for authentication

When reading credentials from the configuration's keystone_authtoken
section auth_uri was used as URL for Keystone.
As auth_uri is a public endpoint that is not necessarily reachable for
the Puppet agent, this change uses the more appropriate auth_url as
Keystone URL.

Change-Id: Iac0c093bbc57a8ae876013d57e74f963e163e4f1
(cherry picked from commit 1ea7ef9cf6)
This commit is contained in:
Matthias Bastian 2018-08-03 13:56:42 +02:00
parent 42162c3b0d
commit c043aeacd1
2 changed files with 4 additions and 4 deletions

View File

@ -45,7 +45,7 @@ class Puppet::Provider::Sahara < Puppet::Provider::Openstack
end
def self.get_sahara_credentials
auth_keys = ['auth_uri', 'admin_tenant_name', 'admin_user',
auth_keys = ['auth_url', 'admin_tenant_name', 'admin_user',
'admin_password']
conf = sahara_conf
if conf and conf['keystone_authtoken'] and
@ -61,7 +61,7 @@ class Puppet::Provider::Sahara < Puppet::Provider::Openstack
def self.get_auth_endpoint
q = sahara_credentials
"#{q['auth_uri']}"
"#{q['auth_url']}"
end
def self.auth_endpoint

View File

@ -24,14 +24,14 @@ describe Puppet::Provider::Sahara do
it 'should read conf file with all sections' do
creds_hash = {
'auth_uri' => 'https://192.168.56.210:35357/v2.0/',
'auth_url' => 'https://192.168.56.210:35357/v2.0/',
'admin_tenant_name' => 'admin_tenant',
'admin_user' => 'admin',
'admin_password' => 'password',
}
mock = {
'keystone_authtoken' => {
'auth_uri' => 'https://192.168.56.210:35357/v2.0/',
'auth_url' => 'https://192.168.56.210:35357/v2.0/',
'admin_tenant_name' => 'admin_tenant',
'admin_user' => 'admin',
'admin_password' => 'password',