Merge "Make providers use auth_url for authentication"

This commit is contained in:
Zuul 2018-08-10 10:14:03 +00:00 committed by Gerrit Code Review
commit 1aff5d593c
4 changed files with 9 additions and 10 deletions

View File

@ -82,7 +82,7 @@ class Puppet::Provider::Nova < Puppet::Provider::Openstack
def self.get_nova_credentials
#needed keys for authentication
auth_keys = ['www_authenticate_uri', 'project_name', 'username', 'password']
auth_keys = ['auth_url', 'project_name', 'username', 'password']
conf = nova_conf
if conf and conf['keystone_authtoken'] and
auth_keys.all?{|k| !conf['keystone_authtoken'][k].nil?}
@ -111,7 +111,7 @@ class Puppet::Provider::Nova < Puppet::Provider::Openstack
def self.get_auth_endpoint
q = nova_credentials
"#{q['www_authenticate_uri']}"
"#{q['auth_url']}"
end
def self.auth_endpoint

View File

@ -50,7 +50,7 @@ Puppet::Type.newtype(:nova_aggregate) do
ensurable
autorequire(:nova_config) do
['www_authenticate_uri', 'project_name', 'username', 'password']
['auth_url', 'project_name', 'username', 'password']
end
newparam(:name, :namevar => true) do

View File

@ -56,7 +56,7 @@ Puppet::Type.newtype(:nova_flavor) do
ensurable
autorequire(:nova_config) do
['www_authenticate_uri', 'project_name', 'username', 'password']
['auth_url', 'project_name', 'username', 'password']
end
# Require the nova-api service to be running
@ -151,4 +151,3 @@ Puppet::Type.newtype(:nova_flavor) do
end
end

View File

@ -11,11 +11,11 @@ describe Puppet::Provider::Nova do
let :credential_hash do
{
'www_authenticate_uri' => 'https://192.168.56.210:5000/v2.0/',
'project_name' => 'admin_tenant',
'username' => 'admin',
'password' => 'password',
'region_name' => 'Region1',
'auth_url' => 'https://192.168.56.210:5000/v2.0/',
'project_name' => 'admin_tenant',
'username' => 'admin',
'password' => 'password',
'region_name' => 'Region1',
}
end