From 876a4bddfe4f6547d1a5517afb923f3f691b3f78 Mon Sep 17 00:00:00 2001 From: Rabi Mishra Date: Mon, 9 Dec 2019 17:05:53 +0530 Subject: [PATCH] Make heat config client_retry_limit configurable This adds a new parameter to configure client_retry_limit config to a value higher than the default. Change-Id: Ibd3999a394c8827efa7a6034e69e55858d2e44ed --- manifests/engine.pp | 6 ++++++ .../add-client-retry-limit-config-097ef24eece57bdf.yaml | 4 ++++ spec/classes/heat_engine_spec.rb | 3 +++ 3 files changed, 13 insertions(+) create mode 100644 releasenotes/notes/add-client-retry-limit-config-097ef24eece57bdf.yaml diff --git a/manifests/engine.pp b/manifests/engine.pp index 244c2c6a..1a48cc9b 100644 --- a/manifests/engine.pp +++ b/manifests/engine.pp @@ -125,6 +125,10 @@ # (Optional) List of directories to search for plug-ins. # Defaults to $::os_service_default # +# [*client_retry_limit*] +# (Optional) Number of times to retry when client encounters a transient error. +# Defaults to $::os_service_default +# # DEPRECATED PARAMETERS # # [*heat_watch_server_url*] @@ -155,6 +159,7 @@ class heat::engine ( $template_dir = $::os_service_default, $max_nested_stack_depth = $::os_service_default, $plugin_dirs = $::os_service_default, + $client_retry_limit = $::os_service_default, # DEPRECATED PARAMETERS $heat_watch_server_url = undef, ) { @@ -233,5 +238,6 @@ class heat::engine ( 'DEFAULT/template_dir': value => $template_dir; 'DEFAULT/max_nested_stack_depth': value => $max_nested_stack_depth; 'DEFAULT/plugin_dirs': value => $plugin_dirs_real; + 'DEFAULT/client_retry_limit': value => $client_retry_limit; } } diff --git a/releasenotes/notes/add-client-retry-limit-config-097ef24eece57bdf.yaml b/releasenotes/notes/add-client-retry-limit-config-097ef24eece57bdf.yaml new file mode 100644 index 00000000..cd02902e --- /dev/null +++ b/releasenotes/notes/add-client-retry-limit-config-097ef24eece57bdf.yaml @@ -0,0 +1,4 @@ +--- +features: + - Add new parameter 'client_retry_limit' to increase + the number of retries in case of transient errors. diff --git a/spec/classes/heat_engine_spec.rb b/spec/classes/heat_engine_spec.rb index f4210863..6fd82ee9 100644 --- a/spec/classes/heat_engine_spec.rb +++ b/spec/classes/heat_engine_spec.rb @@ -20,6 +20,7 @@ describe 'heat::engine' do :template_dir => '', :max_nested_stack_depth => '', :plugin_dirs => '', + :client_retry_limit => '', } end @@ -49,6 +50,7 @@ describe 'heat::engine' do :reauthentication_auth_method => 'trusts', :environment_dir => '/etc/heat/environment.d', :template_dir => '/etc/heat/templates', + :client_retry_limit => 2, } ].each do |new_params| describe 'when #{param_set == {} ? "using default" : "specifying"} parameters' @@ -95,6 +97,7 @@ describe 'heat::engine' do it { is_expected.to contain_heat_config('DEFAULT/environment_dir').with_value( expected_params[:environment_dir] ) } it { is_expected.to contain_heat_config('DEFAULT/template_dir').with_value( expected_params[:template_dir] ) } it { is_expected.to contain_heat_config('DEFAULT/plugin_dirs').with_value('') } + it { is_expected.to contain_heat_config('DEFAULT/client_retry_limit').with_value( expected_params[:client_retry_limit] ) } end context 'with disabled service managing' do