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
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 def self.get_nova_credentials
#needed keys for authentication #needed keys for authentication
auth_keys = ['www_authenticate_uri', 'project_name', 'username', 'password'] auth_keys = ['auth_url', 'project_name', 'username', 'password']
conf = nova_conf conf = nova_conf
if conf and conf['keystone_authtoken'] and if conf and conf['keystone_authtoken'] and
auth_keys.all?{|k| !conf['keystone_authtoken'][k].nil?} 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 def self.get_auth_endpoint
q = nova_credentials q = nova_credentials
"#{q['www_authenticate_uri']}" "#{q['auth_url']}"
end end
def self.auth_endpoint def self.auth_endpoint

View File

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

View File

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

View File

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