Merge "Clean up deprecated parameters of vitrage::auth"
This commit is contained in:
commit
f159b6da02
|
@ -42,29 +42,6 @@
|
|||
# communication with OpenStack services.
|
||||
# Defaults to $::os_service_default.
|
||||
#
|
||||
# DEPRECATED PARAMETERS
|
||||
#
|
||||
# [*auth_endpoint_type*]
|
||||
# (Optional) Type of endpoint in Identity service catalog to use for
|
||||
# communication with OpenStack services.
|
||||
# Defaults to $::os_service_default.
|
||||
#
|
||||
# [*auth_tenant_name*]
|
||||
# the keystone tenant name for vitrage services
|
||||
# Optional. Defaults to undef.
|
||||
#
|
||||
# [*auth_tenant_id*]
|
||||
# (Optional) The keystone tenant id for vitrage services.
|
||||
# Defaults to undef..
|
||||
#
|
||||
# [*project_domain_id*]
|
||||
# (Optional) The keystone project domain id for vitrage services
|
||||
# Defaults to 'default'
|
||||
#
|
||||
# [*user_domain_id*]
|
||||
# (Optional) The keystone user domain id for vitrage services
|
||||
# Defaults to 'default'
|
||||
#
|
||||
class vitrage::auth (
|
||||
$auth_password,
|
||||
$auth_url = 'http://localhost:5000/v3',
|
||||
|
@ -76,69 +53,20 @@ class vitrage::auth (
|
|||
$auth_type = 'password',
|
||||
$auth_cacert = $::os_service_default,
|
||||
$interface = $::os_service_default,
|
||||
# DEPRECATED PARAMETERS
|
||||
$auth_endpoint_type = undef,
|
||||
$auth_tenant_name = undef,
|
||||
$auth_tenant_id = undef,
|
||||
$project_domain_id = undef,
|
||||
$user_domain_id = undef,
|
||||
) {
|
||||
|
||||
include vitrage::deps
|
||||
|
||||
if $auth_endpoint_type != undef {
|
||||
warning('auth_endpoint_type is deprecated and will be removed in a future release. \
|
||||
Use interface instead')
|
||||
$interface_real = $auth_endpoint_type
|
||||
} else {
|
||||
$interface_real = $interface
|
||||
}
|
||||
|
||||
if $auth_tenant_name != undef {
|
||||
warning('auth_tenant_name is deprecated and will be removed in a future release. \
|
||||
Use auth_project_name instead')
|
||||
$auth_project_name_real = $auth_tenant_name
|
||||
} else {
|
||||
$auth_project_name_real = $auth_project_name
|
||||
}
|
||||
|
||||
if $auth_tenant_id != undef {
|
||||
warning('auth_tenant_id is deprecated and has no effect. Use auth_project_name instead.')
|
||||
}
|
||||
|
||||
vitrage_config {
|
||||
'service_credentials/auth_url' : value => $auth_url;
|
||||
'service_credentials/region_name' : value => $auth_region;
|
||||
'service_credentials/username' : value => $auth_user;
|
||||
'service_credentials/password' : value => $auth_password, secret => true;
|
||||
'service_credentials/project_name' : value => $auth_project_name_real;
|
||||
'service_credentials/cacert' : value => $auth_cacert;
|
||||
'service_credentials/interface' : value => $interface_real;
|
||||
'service_credentials/auth_type' : value => $auth_type;
|
||||
'service_credentials/auth_url' : value => $auth_url;
|
||||
'service_credentials/region_name' : value => $auth_region;
|
||||
'service_credentials/username' : value => $auth_user;
|
||||
'service_credentials/password' : value => $auth_password, secret => true;
|
||||
'service_credentials/project_name' : value => $auth_project_name;
|
||||
'service_credentials/user_domain_name' : value => $user_domain_name;
|
||||
'service_credentials/project_domain_name' : value => $project_domain_name;
|
||||
'service_credentials/cacert' : value => $auth_cacert;
|
||||
'service_credentials/interface' : value => $interface;
|
||||
'service_credentials/auth_type' : value => $auth_type;
|
||||
}
|
||||
|
||||
if $project_domain_id != undef {
|
||||
warning('vitrage::auth::project_domain_id is deprecated and will be removed \
|
||||
in a future release. Use project_domain_name instead.')
|
||||
vitrage_config{
|
||||
'service_credentials/project_domain_id' : value => $project_domain_id;
|
||||
}
|
||||
} else {
|
||||
vitrage_config{
|
||||
'service_credentials/project_domain_name' : value => $project_domain_name;
|
||||
}
|
||||
}
|
||||
|
||||
if $user_domain_id != undef {
|
||||
warning('vitrage::auth::user_domain_id is deprecated and will be removed \
|
||||
in a future release. Use user_domain_name instead.')
|
||||
vitrage_config{
|
||||
'service_credentials/user_domain_id' : value => $user_domain_id;
|
||||
}
|
||||
} else {
|
||||
vitrage_config{
|
||||
'service_credentials/user_domain_name' : value => $user_domain_name;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
---
|
||||
upgrade:
|
||||
- |
|
||||
The following parameters of the ``vitrage::auth`` class.
|
||||
|
||||
- ``auth_endpoint_type``
|
||||
- ``auth_tenant_name``
|
||||
- ``auth_tenant_id``
|
||||
- ``project_domain_id``
|
||||
- ``user_domain_id``
|
|
@ -25,22 +25,6 @@ describe 'vitrage::auth' do
|
|||
is_expected.to contain_vitrage_config('service_credentials/cacert').with(:value => '<SERVICE DEFAULT>')
|
||||
end
|
||||
|
||||
context 'when deprecated domain_id is set' do
|
||||
before do
|
||||
params.merge!(
|
||||
:user_domain_id => 'default',
|
||||
:project_domain_id => 'default',
|
||||
)
|
||||
end
|
||||
|
||||
it 'configures domain_id instead of domain_name' do
|
||||
is_expected.to_not contain_vitrage_config('service_credentials/project_domain_name')
|
||||
is_expected.to contain_vitrage_config('service_credentials/project_domain_id').with_value('default')
|
||||
is_expected.to_not contain_vitrage_config('service_credentials/user_domain_name')
|
||||
is_expected.to contain_vitrage_config('service_credentials/user_domain_id').with_value('default')
|
||||
end
|
||||
end
|
||||
|
||||
context 'when overriding parameters' do
|
||||
before do
|
||||
params.merge!(
|
||||
|
|
Loading…
Reference in New Issue