From 9bebfc6b1742135e63f700bbb026fa03a88e0910 Mon Sep 17 00:00:00 2001 From: Evgeny L Date: Thu, 10 Nov 2016 00:51:24 +0000 Subject: [PATCH] Fix default retries parameters for shell tasks Use shell specific parameters shell_retries and shell_interval, instead of mc_retries and mc_interval which are used for retries if node was not accesible via MCollective. Closes-bug: #1641198 Change-Id: I04a4d187ab3aa4cde46b2775766eb88babd46ab7 --- lib/astute/config.rb | 4 +++- lib/astute/tasks/master_shell.rb | 6 +++--- lib/astute/tasks/shell.rb | 4 ++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/astute/config.rb b/lib/astute/config.rb index 5a7a709e..8ada6260 100644 --- a/lib/astute/config.rb +++ b/lib/astute/config.rb @@ -71,9 +71,11 @@ module Astute conf[:reboot_timeout] = 900 # how long it can take for node to reboot conf[:dump_timeout] = 3600 # maximum time it waits for the dump (meaningles to be larger # than the specified in timeout of execute_shell_command mcagent + conf[:shell_retries] = 2 # default retries for shell task + conf[:shell_interval] = 2 # default interval for shell task conf[:shell_timeout] = 300 # default timeout for shell task - conf[:stop_timeout] = 600 # how long it can take for stop conf[:shell_cwd] = '/' # default cwd for shell task + conf[:stop_timeout] = 600 # how long it can take for stop conf[:rsync_options] = '-c -r --delete -l' # default rsync options conf[:keys_src_dir] = '/var/lib/fuel/keys' # path where ssh and openssl keys will be created conf[:puppet_ssh_keys] = [ diff --git a/lib/astute/tasks/master_shell.rb b/lib/astute/tasks/master_shell.rb index ec920f9c..1720c243 100644 --- a/lib/astute/tasks/master_shell.rb +++ b/lib/astute/tasks/master_shell.rb @@ -50,12 +50,12 @@ module Astute def setup_default @task['parameters']['timeout'] ||= Astute.config.shell_timeout @task['parameters']['cwd'] ||= Astute.config.shell_cwd - @task['parameters']['retries'] ||= Astute.config.mc_retries - @task['parameters']['interval'] ||= Astute.config.mc_retry_interval + @task['parameters']['retries'] ||= Astute.config.shell_retries + @task['parameters']['interval'] ||= Astute.config.shell_interval end def generate_master_shell @task.merge('node_id' => 'master') end end -end \ No newline at end of file +end diff --git a/lib/astute/tasks/shell.rb b/lib/astute/tasks/shell.rb index a54ec640..bd8c9f0e 100644 --- a/lib/astute/tasks/shell.rb +++ b/lib/astute/tasks/shell.rb @@ -61,8 +61,8 @@ module Astute def setup_default @task['parameters']['timeout'] ||= Astute.config.shell_timeout @task['parameters']['cwd'] ||= Astute.config.shell_cwd - @task['parameters']['retries'] ||= Astute.config.mc_retries - @task['parameters']['interval'] ||= Astute.config.mc_retry_interval + @task['parameters']['retries'] ||= Astute.config.shell_retries + @task['parameters']['interval'] ||= Astute.config.shell_interval end def puppet_exec_template