diff --git a/lib/puppet/provider/cinder.rb b/lib/puppet/provider/cinder.rb index 7d88aded..0f1821f3 100644 --- a/lib/puppet/provider/cinder.rb +++ b/lib/puppet/provider/cinder.rb @@ -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 = ['www_authenticate_uri', '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['www_authenticate_uri']}" end def self.auth_endpoint diff --git a/manifests/api.pp b/manifests/api.pp index 183a0bc9..08b1166a 100644 --- a/manifests/api.pp +++ b/manifests/api.pp @@ -363,7 +363,7 @@ running as a standalone service, or httpd for being run by a httpd server") $defaults = { 'cinder-api' => { # lint:ignore:140chars - 'command' => "cinder --os-auth-url ${::cinder::keystone::authtoken::auth_uri} --os-project-name ${keystone_project_name} --os-username ${keystone_username} --os-password ${keystone_password} list", + 'command' => "cinder --os-auth-url ${::cinder::keystone::authtoken::www_authenticate_uri} --os-project-name ${keystone_project_name} --os-username ${keystone_username} --os-password ${keystone_password} list", # lint:endignore } } diff --git a/manifests/keystone/authtoken.pp b/manifests/keystone/authtoken.pp index fb7ad546..43e0ead8 100644 --- a/manifests/keystone/authtoken.pp +++ b/manifests/keystone/authtoken.pp @@ -42,7 +42,7 @@ # (Optional) Authentication type to load # Defaults to 'password' # -# [*auth_uri*] +# [*www_authenticate_uri*] # (Optional) Complete public Identity API endpoint. # Defaults to 'http://localhost:5000'. # @@ -183,6 +183,12 @@ # (in seconds). Set to -1 to disable caching completely. Integer value # Defaults to $::os_service_default. # +# DEPRECATED PARAMETERS +# +# [*auth_uri*] +# (Optional) Complete public Identity API endpoint. +# Defaults to undef +# class cinder::keystone::authtoken( $username = 'cinder', $password = $::os_service_default, @@ -193,7 +199,7 @@ class cinder::keystone::authtoken( $insecure = $::os_service_default, $auth_section = $::os_service_default, $auth_type = 'password', - $auth_uri = 'http://localhost:5000', + $www_authenticate_uri = 'http://localhost:5000', $auth_version = $::os_service_default, $cache = $::os_service_default, $cafile = $::os_service_default, @@ -218,6 +224,8 @@ class cinder::keystone::authtoken( $manage_memcache_package = false, $region_name = $::os_service_default, $token_cache_time = $::os_service_default, + # DEPRECATED PARAMETERS + $auth_uri = undef, ) { include ::cinder::deps @@ -226,12 +234,17 @@ class cinder::keystone::authtoken( fail('Please set password for cinder service user') } + if $auth_uri { + warning('The auth_uri parameter is deprecated. Please use www_authenticate_uri instead.') + } + $www_authenticate_uri_real = pick($auth_uri, $www_authenticate_uri) + keystone::resource::authtoken { 'cinder_config': username => $username, password => $password, project_name => $project_name, auth_url => $auth_url, - auth_uri => $auth_uri, + www_authenticate_uri => $www_authenticate_uri_real, auth_version => $auth_version, auth_type => $auth_type, auth_section => $auth_section, diff --git a/releasenotes/notes/deprecate_auth_uri_parameter-a30b9e7c7d8cee38.yaml b/releasenotes/notes/deprecate_auth_uri_parameter-a30b9e7c7d8cee38.yaml new file mode 100644 index 00000000..86d56c01 --- /dev/null +++ b/releasenotes/notes/deprecate_auth_uri_parameter-a30b9e7c7d8cee38.yaml @@ -0,0 +1,4 @@ +--- +deprecations: + - auth_uri is deprecated and will be removed in a future release. + Please use www_authenticate_uri instead. diff --git a/spec/classes/cinder_keystone_authtoken_spec.rb b/spec/classes/cinder_keystone_authtoken_spec.rb index 3d1996b4..ff9c45b9 100644 --- a/spec/classes/cinder_keystone_authtoken_spec.rb +++ b/spec/classes/cinder_keystone_authtoken_spec.rb @@ -20,7 +20,7 @@ describe 'cinder::keystone::authtoken' do is_expected.to contain_cinder_config('keystone_authtoken/insecure').with_value('') is_expected.to contain_cinder_config('keystone_authtoken/auth_section').with_value('') is_expected.to contain_cinder_config('keystone_authtoken/auth_type').with_value('password') - is_expected.to contain_cinder_config('keystone_authtoken/auth_uri').with_value('http://localhost:5000') + is_expected.to contain_cinder_config('keystone_authtoken/www_authenticate_uri').with_value('http://localhost:5000') is_expected.to contain_cinder_config('keystone_authtoken/auth_version').with_value('') is_expected.to contain_cinder_config('keystone_authtoken/cache').with_value('') is_expected.to contain_cinder_config('keystone_authtoken/cafile').with_value('') @@ -50,7 +50,7 @@ describe 'cinder::keystone::authtoken' do context 'when overriding parameters' do before do params.merge!({ - :auth_uri => 'https://10.0.0.1:9999/', + :www_authenticate_uri => 'https://10.0.0.1:9999/', :username => 'myuser', :password => 'mypasswd', :auth_url => 'https://127.0.0.1:35357', @@ -88,7 +88,7 @@ describe 'cinder::keystone::authtoken' do end it 'configure keystone_authtoken' do - is_expected.to contain_cinder_config('keystone_authtoken/auth_uri').with_value('https://10.0.0.1:9999/') + is_expected.to contain_cinder_config('keystone_authtoken/www_authenticate_uri').with_value('https://10.0.0.1:9999/') is_expected.to contain_cinder_config('keystone_authtoken/username').with_value(params[:username]) is_expected.to contain_cinder_config('keystone_authtoken/password').with_value(params[:password]).with_secret(true) is_expected.to contain_cinder_config('keystone_authtoken/auth_url').with_value(params[:auth_url]) diff --git a/spec/unit/provider/cinder_spec.rb b/spec/unit/provider/cinder_spec.rb index dcc9dbb7..3e2c46aa 100644 --- a/spec/unit/provider/cinder_spec.rb +++ b/spec/unit/provider/cinder_spec.rb @@ -24,19 +24,19 @@ 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/', - 'project_name' => 'admin_tenant', - 'username' => 'admin', - 'password' => 'password', - 'project_domain_name' => 'Default', - 'user_domain_name' => 'Default', + 'www_authenticate_uri' => 'https://192.168.56.210:35357/v2.0/', + 'project_name' => 'admin_tenant', + 'username' => 'admin', + 'password' => 'password', + 'project_domain_name' => 'Default', + 'user_domain_name' => 'Default', } mock = { 'keystone_authtoken' => { - 'auth_uri' => 'https://192.168.56.210:35357/v2.0/', - 'project_name' => 'admin_tenant', - 'username' => 'admin', - 'password' => 'password', + 'www_authenticate_uri' => 'https://192.168.56.210:35357/v2.0/', + 'project_name' => 'admin_tenant', + 'username' => 'admin', + 'password' => 'password', } } Puppet::Util::IniConfig::File.expects(:new).returns(mock)