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: I16145064b8867c64abddf4a12f460464ee2d9c04
(cherry picked from commit 642666b15e
)
This commit is contained in:
parent
641e0368c5
commit
7472908955
|
@ -52,7 +52,7 @@ class Puppet::Provider::Cinder < Puppet::Provider::Openstack
|
|||
end
|
||||
|
||||
def self.get_cinder_credentials
|
||||
auth_keys = ['auth_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['auth_uri']}"
|
||||
"#{q['auth_url']}"
|
||||
end
|
||||
|
||||
def self.auth_endpoint
|
||||
|
|
|
@ -24,7 +24,7 @@ describe Puppet::Provider::Cinder 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/',
|
||||
'project_name' => 'admin_tenant',
|
||||
'username' => 'admin',
|
||||
'password' => 'password',
|
||||
|
@ -33,7 +33,7 @@ describe Puppet::Provider::Cinder do
|
|||
}
|
||||
mock = {
|
||||
'keystone_authtoken' => {
|
||||
'auth_uri' => 'https://192.168.56.210:35357/v2.0/',
|
||||
'auth_url' => 'https://192.168.56.210:35357/v2.0/',
|
||||
'project_name' => 'admin_tenant',
|
||||
'username' => 'admin',
|
||||
'password' => 'password',
|
||||
|
|
Loading…
Reference in New Issue