Remove old authtoken options

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

Change-Id: I2e5569896e0d34dc9380582bf81826584bd69809
This commit is contained in:
Iury Gregory Melo Ferreira
2016-11-06 00:05:22 -03:00
parent ede2deb1fd
commit 3de5b5ddfd
4 changed files with 26 additions and 66 deletions

View File

@@ -45,7 +45,7 @@
# Defaults to false
#
# [*auth_strategy*]
# (optional) Configure gnocchi authentication.
# (optional) Configure gnocchi authentication.
# Can be set to noauth and keystone.
# Defaults to 'keystone'.
#
@@ -54,29 +54,6 @@
# HTTPProxyToWSGI middleware.
# Defaults to $::os_service_default.
#
# = DEPRECATED PARAMETERS
#
# [*keystone_user*]
# (optional) DEPRECATED. Use gnocchi::keystone::authtoken::username instead.
# Defaults to undef
#
# [*keystone_tenant*]
# (optional) DEPRECATED. Use gnocchi::keystone::authtoken::project_name
# instead.
# Defaults to undef
#
# [*keystone_password*]
# (optional) DEPRECATED. Use gnocchi::keystone::authtoken::password instead.
# Defaults to undef
#
# [*keystone_auth_uri*]
# (optional) DEPRECATED. Use gnocchi::keystone::authtoken::auth_uri instead.
# Defaults to undef
#
# [*keystone_identity_uri*]
# (optional) DEPRECATED. Use gnocchi::keystone::authtoken::auth_url instead.
# Defaults to undef
#
class gnocchi::api (
$manage_service = true,
$enabled = true,
@@ -89,36 +66,10 @@ class gnocchi::api (
$sync_db = false,
$auth_strategy = 'keystone',
$enable_proxy_headers_parsing = $::os_service_default,
# DEPRECATED PARAMETERS
$keystone_user = undef,
$keystone_tenant = undef,
$keystone_password = undef,
$keystone_auth_uri = undef,
$keystone_identity_uri = undef,
) inherits gnocchi::params {
include ::gnocchi::policy
if $keystone_identity_uri {
warning('gnocchi:api::keystone_identity_uri is deprecated, use gnocchi::keystone::authtoken::auth_url instead')
}
if $keystone_auth_uri {
warning('gnocchi::api::keystone_auth_uri is deprecated, use gnocchi::keystone::authtoken::auth_uri instead')
}
if $keystone_user {
warning('gnocchi::api::keystone_user is deprecated, use gnocchi::keystone::authtoken::username instead')
}
if $keystone_tenant {
warning('gnocchi::api::keystone_tenant is deprecated, use gnocchi::keystone::authtoken::project_name instead')
}
if $keystone_password {
warning('gnocchi::api::keystone_password is deprecated, use gnocchi::keystone::authtoken::password instead')
}
Gnocchi_config<||> ~> Service[$service_name]
Gnocchi_api_paste_ini<||> ~> Service[$service_name]
Class['gnocchi::policy'] ~> Service[$service_name]

View File

@@ -223,22 +223,16 @@ class gnocchi::keystone::authtoken(
$token_cache_time = $::os_service_default,
) {
if is_service_default($password) and ! $::gnocchi::api::keystone_password {
if is_service_default($password) {
fail('Please set password for Gnocchi service user')
}
$username_real = pick($::gnocchi::api::keystone_user,$username)
$password_real = pick($::gnocchi::api::keystone_password,$password)
$project_name_real = pick($::gnocchi::api::keystone_tenant,$project_name)
$auth_uri_real = pick($::gnocchi::api::keystone_auth_uri, $auth_uri)
$auth_url_real = pick($::gnocchi::api::keystone_identity_uri, $auth_url)
keystone::resource::authtoken { 'gnocchi_config':
username => $username_real,
password => $password_real,
project_name => $project_name_real,
auth_url => $auth_url_real,
auth_uri => $auth_uri_real,
username => $username,
password => $password,
project_name => $project_name,
auth_url => $auth_url,
auth_uri => $auth_uri,
auth_version => $auth_version,
auth_type => $auth_type,
auth_section => $auth_section,

View File

@@ -0,0 +1,7 @@
---
other:
- removed deprecated gnocchi::api::keystone_user
- removed deprecated gnocchi::api::keystone_password
- removed deprecated gnocchi::api::keystone_tenant
- removed deprecated gnocchi::api::keystone_auth_uri
- removed deprecated gnocchi::api::keystone_identity_uri

View File

@@ -4,13 +4,15 @@ describe 'gnocchi::api' do
let :pre_condition do
"class { 'gnocchi': }
include ::gnocchi::db"
include ::gnocchi::db
class { '::gnocchi::keystone::authtoken':
password => 'gnocchi-passw0rd',
}"
end
let :params do
{ :enabled => true,
:manage_service => true,
:keystone_password => 'gnocchi-passw0rd',
:package_ensure => 'latest',
:port => '8041',
:max_limit => '1000',
@@ -94,7 +96,10 @@ describe 'gnocchi::api' do
let :pre_condition do
"include ::apache
include ::gnocchi::db
class { 'gnocchi': }"
class { 'gnocchi': }
class { '::gnocchi::keystone::authtoken':
password => 'gnocchi-passw0rd',
}"
end
it 'configures gnocchi-api service with Apache' do
@@ -115,7 +120,10 @@ describe 'gnocchi::api' do
let :pre_condition do
"include ::apache
include ::gnocchi::db
class { 'gnocchi': }"
class { 'gnocchi': }
class { '::gnocchi::keystone::authtoken':
password => 'gnocchi-passw0rd',
}"
end
it_raises 'a Puppet::Error', /Invalid service_name/