From 99c035e7208e844cc766a5a07d5beb16622f5b75 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Mon, 25 Mar 2024 10:48:32 +0900 Subject: [PATCH] Deprecate broken trove::single_tenant_mode Closes-Bug: #2058861 Change-Id: Ia275e45483cb5238c6440cb2abd2c96c3036306d --- manifests/init.pp | 34 +++++++------------ .../notes/bug-2058861-5b9681aa693a44e7.yaml | 5 +++ spec/classes/trove_init_spec.rb | 25 -------------- 3 files changed, 18 insertions(+), 46 deletions(-) create mode 100644 releasenotes/notes/bug-2058861-5b9681aa693a44e7.yaml diff --git a/manifests/init.pp b/manifests/init.pp index a9e50513..2ae2839f 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -195,11 +195,6 @@ # (Optional) Password for message broker authentication # Defaults to $facts['os_service_default']. # -# [*single_tenant_mode*] -# (optional) If set to true, will configure Trove to work in single -# tenant mode. -# Defaults to false. -# # [*rpc_response_timeout*] # (Optional) Seconds to wait for a response from a call. # Defaults to $facts['os_service_default'] @@ -292,6 +287,13 @@ # (optional) The state of the package. # Defaults to 'present' # +# DEPRECATED PARAMETERS +# +# [*single_tenant_mode*] +# (optional) If set to true, will configure Trove to work in single +# tenant mode. +# Defaults to undef. +# class trove( $default_transport_url = $facts['os_service_default'], $notification_transport_url = $facts['os_service_default'], @@ -330,7 +332,6 @@ class trove( $amqp_sasl_config_name = $facts['os_service_default'], $amqp_username = $facts['os_service_default'], $amqp_password = $facts['os_service_default'], - Boolean $single_tenant_mode = false, $rpc_response_timeout = $facts['os_service_default'], $control_exchange = 'trove', $nova_compute_url = $facts['os_service_default'], @@ -354,12 +355,18 @@ class trove( $volume_rootdisk_support = $facts['os_service_default'], $volume_rootdisk_size = $facts['os_service_default'], $package_ensure = 'present', + # DEPRECATED PARAMETERS + $single_tenant_mode = undef, ) { include trove::deps include trove::policy include trove::params + if $single_tenant_mode != undef { + warning('The single_tenant_mode parameter is deprecated and has no effect.') + } + package { 'trove': ensure => $package_ensure, name => $::trove::params::common_package_name, @@ -394,21 +401,6 @@ class trove( 'DEFAULT/trove_endpoint_type': value => $trove_endpoint_type; } - if $single_tenant_mode { - trove_config { - 'DEFAULT/remote_nova_client': value => 'trove.common.single_tenant_remote.nova_client_trove_admin'; - 'DEFAULT/remote_cinder_client': value => 'trove.common.single_tenant_remote.cinder_client_trove_admin'; - 'DEFAULT/remote_neutron_client': value => 'trove.common.single_tenant_remote.neutron_client_trove_admin'; - } - } - else { - trove_config { - 'DEFAULT/remote_nova_client': ensure => absent; - 'DEFAULT/remote_cinder_client': ensure => absent; - 'DEFAULT/remote_neutron_client': ensure => absent; - } - } - # network trove_config { 'DEFAULT/network_label_regex': value => '.*'; diff --git a/releasenotes/notes/bug-2058861-5b9681aa693a44e7.yaml b/releasenotes/notes/bug-2058861-5b9681aa693a44e7.yaml new file mode 100644 index 00000000..910bc37f --- /dev/null +++ b/releasenotes/notes/bug-2058861-5b9681aa693a44e7.yaml @@ -0,0 +1,5 @@ +--- +deprecations: + - | + The ``trove::single_tenant_mode`` parameter has been deprecated and it has + no effect now. diff --git a/spec/classes/trove_init_spec.rb b/spec/classes/trove_init_spec.rb index 1fd08c58..b597c7c3 100644 --- a/spec/classes/trove_init_spec.rb +++ b/spec/classes/trove_init_spec.rb @@ -47,9 +47,6 @@ describe 'trove' do is_expected.to contain_trove_config('DEFAULT/trove_volume_support').with_value('') is_expected.to contain_trove_config('DEFAULT/volume_rootdisk_support').with_value('') is_expected.to contain_trove_config('DEFAULT/volume_rootdisk_size').with_value('') - is_expected.to contain_trove_config('DEFAULT/remote_nova_client').with_ensure('absent') - is_expected.to contain_trove_config('DEFAULT/remote_cinder_client').with_ensure('absent') - is_expected.to contain_trove_config('DEFAULT/remote_neutron_client').with_ensure('absent') is_expected.to contain_oslo__messaging__default('trove_config').with( :transport_url => '', :rpc_response_timeout => '', @@ -146,28 +143,6 @@ describe 'trove' do is_expected.to contain_trove_config('DEFAULT/volume_rootdisk_size').with_value(10) end end - - context 'with single tenant mode enabled' do - let :params do - { :single_tenant_mode => true } - end - - it 'single tenant client values are set' do - is_expected.to contain_trove_config('DEFAULT/remote_nova_client').with_value('trove.common.single_tenant_remote.nova_client_trove_admin') - is_expected.to contain_trove_config('DEFAULT/remote_cinder_client').with_value('trove.common.single_tenant_remote.cinder_client_trove_admin') - is_expected.to contain_trove_config('DEFAULT/remote_neutron_client').with_value('trove.common.single_tenant_remote.neutron_client_trove_admin') - end - end - - context 'with management networks' do - let :params do - { :management_networks => 'trove_service' } - end - - it 'configures management networks' do - is_expected.to contain_trove_config('DEFAULT/management_networks').with_value('trove_service') - end - end end on_supported_os({