Merge "Add support for cinder_internal_tenant_* parameters"

This commit is contained in:
Zuul 2021-06-20 17:09:18 +00:00 committed by Gerrit Code Review
commit d73ebdd432
3 changed files with 49 additions and 11 deletions

View File

@ -232,6 +232,16 @@
# support it.
# Defaults to $::os_service_default.
#
# [*cinder_internal_tenant_project_id*]
# (optional) ID of the project which will be used as the Cinder internal
# tenant.
# Defaults to $::os_service_default.
#
# [*cinder_internal_tenant_user_id*]
# (optional) ID of the user to be used in volume operations as the Cinder
# internal tenant.
# Defaults to $::os_service_default.
#
# DEPRECATED PARAMETERS
#
# [*database_min_pool_size*]
@ -335,6 +345,8 @@ class cinder (
$enable_new_services = $::os_service_default,
$purge_config = false,
$enable_force_upload = $::os_service_default,
$cinder_internal_tenant_project_id = $::os_service_default,
$cinder_internal_tenant_user_id = $::os_service_default,
# DEPRECATED PARAMETERS
$database_min_pool_size = undef,
$database_connection = undef,
@ -452,16 +464,18 @@ removed in a future realse. Use cinder::db::database_max_overflow instead')
}
cinder_config {
'DEFAULT/report_interval': value => $report_interval;
'DEFAULT/service_down_time': value => $service_down_time;
'DEFAULT/api_paste_config': value => $api_paste_config;
'DEFAULT/storage_availability_zone': value => $storage_availability_zone;
'DEFAULT/default_availability_zone': value => $default_availability_zone_real;
'DEFAULT/allow_availability_zone_fallback': value => $allow_availability_zone_fallback;
'DEFAULT/image_conversion_dir': value => $image_conversion_dir;
'DEFAULT/host': value => $host;
'DEFAULT/enable_new_services': value => $enable_new_services;
'DEFAULT/enable_force_upload': value => $enable_force_upload;
'DEFAULT/report_interval': value => $report_interval;
'DEFAULT/service_down_time': value => $service_down_time;
'DEFAULT/api_paste_config': value => $api_paste_config;
'DEFAULT/storage_availability_zone': value => $storage_availability_zone;
'DEFAULT/default_availability_zone': value => $default_availability_zone_real;
'DEFAULT/allow_availability_zone_fallback': value => $allow_availability_zone_fallback;
'DEFAULT/image_conversion_dir': value => $image_conversion_dir;
'DEFAULT/host': value => $host;
'DEFAULT/enable_new_services': value => $enable_new_services;
'DEFAULT/enable_force_upload': value => $enable_force_upload;
'DEFAULT/cinder_internal_tenant_project_id': value => $cinder_internal_tenant_project_id;
'DEFAULT/cinder_internal_tenant_user_id': value => $cinder_internal_tenant_user_id;
}
if $backend_host != undef {

View File

@ -0,0 +1,7 @@
---
features:
- |
Now the ``cinder`` class supports the following two parameters.
- ``cinder_internal_tenant_project_id``
- ``cinder_internal_tenant_user_id``

View File

@ -43,9 +43,13 @@ describe 'cinder' do
is_expected.to contain_cinder_config('DEFAULT/default_availability_zone').with(:value => 'nova')
is_expected.to contain_cinder_config('DEFAULT/allow_availability_zone_fallback').with(:value => '<SERVICE DEFAULT>')
is_expected.to contain_cinder_config('DEFAULT/api_paste_config').with(:value => '/etc/cinder/api-paste.ini')
is_expected.to contain_cinder_config('oslo_concurrency/lock_path').with(:value => '/var/lock/cinder')
is_expected.to contain_cinder_config('DEFAULT/image_conversion_dir').with_value('<SERVICE DEFAULT>')
is_expected.to contain_cinder_config('DEFAULT/host').with_value('<SERVICE DEFAULT>')
is_expected.to contain_cinder_config('DEFAULT/enable_new_services').with_value('<SERVICE DEFAULT>')
is_expected.to contain_cinder_config('oslo_concurrency/lock_path').with(:value => '/var/lock/cinder')
is_expected.to contain_cinder_config('DEFAULT/enable_force_upload').with_value('<SERVICE DEFAULT>')
is_expected.to contain_cinder_config('DEFAULT/cinder_internal_tenant_project_id').with_value('<SERVICE DEFAULT>')
is_expected.to contain_cinder_config('DEFAULT/cinder_internal_tenant_user_id').with_value('<SERVICE DEFAULT>')
# backend_host should not be written to DEFAULT section
is_expected.not_to contain_cinder_config('DEFAULT/backend_host')
@ -284,6 +288,19 @@ describe 'cinder' do
is_expected.to contain_cinder_config('DEFAULT/enable_force_upload').with_value(true)
end
end
context 'with internal tenant parameters' do
let :params do
req_params.merge!({
:cinder_internal_tenant_project_id => 'projectid',
:cinder_internal_tenant_user_id => 'userid',
})
end
it 'should set internal tenant parameters' do
is_expected.to contain_cinder_config('DEFAULT/cinder_internal_tenant_project_id').with_value('projectid')
is_expected.to contain_cinder_config('DEFAULT/cinder_internal_tenant_user_id').with_value('userid')
end
end
end
on_supported_os({