Remove old authtoken options

Since we are in ocata lets remove all old parameters
in api to configure the keystone_authtoken section

Change-Id: I101d1d38ad405dd8a418cb63f7345f7fd700cebe
This commit is contained in:
Iury Gregory Melo Ferreira 2016-11-05 13:26:35 -03:00
parent 7c34dbff35
commit b39fa37eae
4 changed files with 27 additions and 104 deletions

View File

@ -46,32 +46,6 @@
# HTTPProxyToWSGI middleware. # HTTPProxyToWSGI middleware.
# Defaults to $::os_service_default. # Defaults to $::os_service_default.
# #
# = DEPRECATED PARAMETER
#
# [*identity_uri*]
# (Optional) DEPRECATED Use ceilometer::keystone::authtoken::auth_url instead.
# Defaults to undef
#
# [*auth_uri*]
# (Optional) DEPRECATED Use ceilometer::keystone::authtoken::auth_uri instead
# Defaults to undef
#
# [*keystone_user*]
# (Optional) DEPRECATED Use ceilometer::keystone::authtoken::username instead.
# Defaults to undef
#
# [*keystone_tenant*]
# (Optional) DEPRECATED Use ceilometer::keystone::authtoken::project_name instead.
# Defaults to undef
#
# [*keystone_password*]
# (Optional) DEPRECATED. Use ceilometer::keystone::authtoken::password instead.
# Defaults to undef
#
# [*memcached_servers*]
# (Optional) DEPRECATED. Use ceilometer::keystone::authtoken::memcached_servers instead.
# Defaults to undef
#
class ceilometer::api ( class ceilometer::api (
$manage_service = true, $manage_service = true,
$enabled = true, $enabled = true,
@ -82,13 +56,6 @@ class ceilometer::api (
$api_workers = $::os_service_default, $api_workers = $::os_service_default,
$auth_strategy = 'keystone', $auth_strategy = 'keystone',
$enable_proxy_headers_parsing = $::os_service_default, $enable_proxy_headers_parsing = $::os_service_default,
# DEPRECATED PARAMETERS
$identity_uri = undef,
$auth_uri = undef,
$keystone_user = undef,
$keystone_tenant = undef,
$keystone_password = undef,
$memcached_servers = undef,
) inherits ceilometer::params { ) inherits ceilometer::params {
include ::ceilometer::params include ::ceilometer::params
@ -98,31 +65,6 @@ class ceilometer::api (
include ::ceilometer::keystone::authtoken include ::ceilometer::keystone::authtoken
} }
if $identity_uri {
warning('ceilometer::api::identity_uri is deprecated, use ceilometer::keystone::authtoken::auth_url instead')
}
if $auth_uri {
warning('ceilometer::api::auth_uri is deprecated, use ceilometer::keystone::authtoken::auth_uri instead')
}
if $keystone_user {
warning('ceilometer::api::keystone_user is deprecated, use ceilometer::keystone::authtoken::username instead')
}
if $keystone_tenant {
warning('ceilometer::api::keystone_tenant is deprecated, use ceilometer::keystone::authtoken::project_name instead')
}
if $keystone_password {
warning('ceilometer::api::keystone_password is deprecated, use ceilometer::keystone::authtoken::password instead')
}
if $memcached_servers {
warning('ceilometer::api::memcached_servers is deprecated, use ceilometer::keystone::authtoken::memcached_servers instead')
}
Ceilometer_config<||> ~> Service[$service_name] Ceilometer_config<||> ~> Service[$service_name]
Class['ceilometer::policy'] ~> Service[$service_name] Class['ceilometer::policy'] ~> Service[$service_name]

View File

@ -223,23 +223,16 @@ class ceilometer::keystone::authtoken(
$token_cache_time = $::os_service_default, $token_cache_time = $::os_service_default,
) { ) {
if is_service_default($password) and ! $::ceilometer::api::keystone_password { if is_service_default($password) {
fail('Please set password for ceilometer service user') fail('Please set password for ceilometer service user')
} }
$username_real = pick($::ceilometer::api::keystone_user,$username)
$password_real = pick($::ceilometer::api::keystone_password,$password)
$project_name_real = pick($::ceilometer::api::keystone_tenant,$project_name)
$auth_uri_real = pick($::ceilometer::api::auth_uri, $auth_uri)
$auth_url_real = pick($::ceilometer::api::identity_uri, $auth_url)
$memcached_servers_real = pick($::ceilometer::api::memcached_servers, $memcached_servers)
keystone::resource::authtoken { 'ceilometer_config': keystone::resource::authtoken { 'ceilometer_config':
username => $username_real, username => $username,
password => $password_real, password => $password,
project_name => $project_name_real, project_name => $project_name,
auth_url => $auth_url_real, auth_url => $auth_url,
auth_uri => $auth_uri_real, auth_uri => $auth_uri,
auth_version => $auth_version, auth_version => $auth_version,
auth_type => $auth_type, auth_type => $auth_type,
auth_section => $auth_section, auth_section => $auth_section,
@ -265,7 +258,7 @@ class ceilometer::keystone::authtoken(
memcache_security_strategy => $memcache_security_strategy, memcache_security_strategy => $memcache_security_strategy,
memcache_use_advanced_pool => $memcache_use_advanced_pool, memcache_use_advanced_pool => $memcache_use_advanced_pool,
memcache_pool_unused_timeout => $memcache_pool_unused_timeout, memcache_pool_unused_timeout => $memcache_pool_unused_timeout,
memcached_servers => $memcached_servers_real, memcached_servers => $memcached_servers,
region_name => $region_name, region_name => $region_name,
revocation_cache_time => $revocation_cache_time, revocation_cache_time => $revocation_cache_time,
signing_dir => $signing_dir, signing_dir => $signing_dir,

View File

@ -0,0 +1,8 @@
---
other:
- removed deprecated ceilometer::api::keystone_user
- removed deprecated ceilometer::api::keystone_password
- removed deprecated ceilometer::api::keystone_tenant
- removed deprecated ceilometer::api::auth_uri
- removed deprecated ceilometer::api::identity_uri
- removed deprecated ceilometer::api::memcached_servers

View File

@ -4,13 +4,15 @@ describe 'ceilometer::api' do
let :pre_condition do let :pre_condition do
"class { 'ceilometer': telemetry_secret => 's3cr3t' } "class { 'ceilometer': telemetry_secret => 's3cr3t' }
include ::ceilometer::db" include ::ceilometer::db
class { '::ceilometer::keystone::authtoken':
password => 'a_big_secret',
}"
end end
let :params do let :params do
{ :enabled => true, { :enabled => true,
:manage_service => true, :manage_service => true,
:keystone_password => 'ceilometer-passw0rd',
:host => '0.0.0.0', :host => '0.0.0.0',
:port => '8777', :port => '8777',
:package_ensure => 'latest', :package_ensure => 'latest',
@ -58,34 +60,6 @@ describe 'ceilometer::api' do
end end
end end
context 'with deprecated parameters' do
before do
params.merge!({
:auth_uri => 'https://10.0.0.1:5000/deprecated',
:keystone_user => 'myuser',
:keystone_password => 'mypasswd',
:identity_uri => 'http://10.0.0.1:35357/deprecated',
:keystone_tenant => 'service_project',
:memcached_servers => ['memcached01:11211','memcached02:11211'],
})
end
it 'configures keystone_authtoken middleware' do
is_expected.to contain_ceilometer_config(
'keystone_authtoken/auth_uri').with_value(params[:auth_uri])
is_expected.to contain_ceilometer_config(
'keystone_authtoken/username').with_value(params[:keystone_user])
is_expected.to contain_ceilometer_config(
'keystone_authtoken/password').with_value(params[:keystone_password]).with_secret(true)
is_expected.to contain_ceilometer_config(
'keystone_authtoken/auth_url').with_value(params[:identity_uri])
is_expected.to contain_ceilometer_config(
'keystone_authtoken/project_name').with_value(params[:keystone_tenant])
is_expected.to contain_ceilometer_config(
'keystone_authtoken/memcached_servers').with_value('memcached01:11211,memcached02:11211')
end
end
context 'with enable_proxy_headers_parsing' do context 'with enable_proxy_headers_parsing' do
before do before do
params.merge!({:enable_proxy_headers_parsing => true }) params.merge!({:enable_proxy_headers_parsing => true })
@ -121,7 +95,10 @@ describe 'ceilometer::api' do
let :pre_condition do let :pre_condition do
"include ::apache "include ::apache
include ::ceilometer::db include ::ceilometer::db
class { 'ceilometer': telemetry_secret => 's3cr3t' }" class { 'ceilometer': telemetry_secret => 's3cr3t' }
class { '::ceilometer::keystone::authtoken':
password => 'a_big_secret',
}"
end end
it 'configures ceilometer-api service with Apache' do it 'configures ceilometer-api service with Apache' do
@ -142,7 +119,10 @@ describe 'ceilometer::api' do
let :pre_condition do let :pre_condition do
"include ::apache "include ::apache
include ::ceilometer::db include ::ceilometer::db
class { 'ceilometer': telemetry_secret => 's3cr3t' }" class { 'ceilometer': telemetry_secret => 's3cr3t' }
class { '::ceilometer::keystone::authtoken':
password => 'a_big_secret',
}"
end end
it_raises 'a Puppet::Error', /Invalid service_name/ it_raises 'a Puppet::Error', /Invalid service_name/