diff --git a/manifests/db_cfapi.pp b/manifests/db_cfapi.pp index 955b25a..cb22176 100644 --- a/manifests/db_cfapi.pp +++ b/manifests/db_cfapi.pp @@ -13,7 +13,7 @@ # Set to -1 to specify an infinite retry count. # Defaults to $::os_service_default. # -# [*database_idle_timeout*] +# [*database_connection_recycle_time*] # (Optional) Timeout before idle SQL connections are reaped. # Defaults to $::os_service_default. # @@ -34,28 +34,39 @@ # before error is raised. Set to -1 to specify an infinite retry count. # Defaults to $::os_service_default # +# DEPRECATED PARAMETERS +# +# [*database_idle_timeout*] +# (Optional) Timeout before idle SQL connections are reaped. +# Defaults to undef +# class murano::db_cfapi ( - $database_connection = $::os_service_default, - $database_idle_timeout = $::os_service_default, - $database_max_pool_size = $::os_service_default, - $database_max_retries = $::os_service_default, - $database_retry_interval = $::os_service_default, - $database_max_overflow = $::os_service_default, - $database_db_max_retries = $::os_service_default, + $database_connection = $::os_service_default, + $database_connection_recycle_time = $::os_service_default, + $database_max_pool_size = $::os_service_default, + $database_max_retries = $::os_service_default, + $database_retry_interval = $::os_service_default, + $database_max_overflow = $::os_service_default, + $database_db_max_retries = $::os_service_default, + # DEPRECATED PARAMETERS + $database_idle_timeout = undef, ) { include murano::deps - if !is_service_default($database_connection) { + if $database_idle_timeout != undef { + warning('The database_idle_timeout parameter is deprecated and has no effect.') + } + if !is_service_default($database_connection) { oslo::db { 'murano_cfapi_config': - connection => $database_connection, - idle_timeout => $database_idle_timeout, - max_pool_size => $database_max_pool_size, - max_retries => $database_max_retries, - retry_interval => $database_retry_interval, - max_overflow => $database_max_overflow, - db_max_retries => $database_db_max_retries, + connection => $database_connection, + connection_recycle_time => $database_connection_recycle_time, + max_pool_size => $database_max_pool_size, + max_retries => $database_max_retries, + retry_interval => $database_retry_interval, + max_overflow => $database_max_overflow, + db_max_retries => $database_db_max_retries, } } diff --git a/releasenotes/notes/deprecate-remaining-idle_timeout-parameter-6568fe0e18eacb17.yaml b/releasenotes/notes/deprecate-remaining-idle_timeout-parameter-6568fe0e18eacb17.yaml new file mode 100644 index 0000000..7620573 --- /dev/null +++ b/releasenotes/notes/deprecate-remaining-idle_timeout-parameter-6568fe0e18eacb17.yaml @@ -0,0 +1,11 @@ +--- +features: + - | + The new ``murano::db_cfapi::connection_recycle_time`` parameter has been + added. + +deprecations: + - | + The ``murano::db_cfapi::database_idle_timeout`` parameter has been + deprecated. The parameter has had no effect since the same parameter + in puppet-oslo was deprecated. diff --git a/spec/classes/murano_db_cfapi_spec.rb b/spec/classes/murano_db_cfapi_spec.rb index bea274f..3d57f52 100644 --- a/spec/classes/murano_db_cfapi_spec.rb +++ b/spec/classes/murano_db_cfapi_spec.rb @@ -10,24 +10,24 @@ describe 'murano::db_cfapi' do context 'with specific parameters' do let :params do - { :database_connection => 'mysql+pymysql://murano_cfapi:murano_cfapi@localhost/murano_cfapi', - :database_idle_timeout => '3601', - :database_max_retries => '11', - :database_retry_interval => '11', - :database_max_pool_size => '11', - :database_max_overflow => '21', - :database_db_max_retries => '-1', + { :database_connection => 'mysql+pymysql://murano_cfapi:murano_cfapi@localhost/murano_cfapi', + :database_connection_recycle_time => '3601', + :database_max_retries => '11', + :database_retry_interval => '11', + :database_max_pool_size => '11', + :database_max_overflow => '21', + :database_db_max_retries => '-1', } end it { should contain_oslo__db('murano_cfapi_config').with( - :connection => 'mysql+pymysql://murano_cfapi:murano_cfapi@localhost/murano_cfapi', - :idle_timeout => '3601', - :max_pool_size => '11', - :max_retries => '11', - :retry_interval => '11', - :max_overflow => '21', - :db_max_retries => '-1', + :connection => 'mysql+pymysql://murano_cfapi:murano_cfapi@localhost/murano_cfapi', + :connection_recycle_time => '3601', + :max_pool_size => '11', + :max_retries => '11', + :retry_interval => '11', + :max_overflow => '21', + :db_max_retries => '-1', )} end