B #2964: Fix bug and add rescue to control exceptions (#2996)

(cherry picked from commit 3297dd48fc)
This commit is contained in:
Alejandro Huertas Herrero authored and Tino Vazquez committed 2019-02-27 17:45:43 +01:00
1 parent d9d9f90a7e
commit f647662ec0
2 files changed
+7 -1

No files matched your search

+2
View File
@@ -149,6 +149,8 @@ module OneProvision
raise OneProvisionLoopException, errors
end
rescue StandardError
raise OneProvisionLoopException
end
# Retries ssh connection
+5 -1
View File
@@ -115,13 +115,17 @@ module OneProvision
instance.run_mode[:fail_choice] = :cleanup
elsif options.key? :fail_retry
instance.run_mode[:fail_choice] = :retry
instance.run_mode[:max_retries] = options[:fail_retry].to_i
elsif options.key? :fail_skip
instance.run_mode[:fail_choice] = :skip
elsif options.key? :fail_quit
instance.run_mode[:fail_choice] = :quit
else
instance.run_mode[:fail_choice] = FAIL_CHOICE_DEFAULT
end
if options[:fail_retry]
instance.run_mode[:max_retries] = options[:fail_retry].to_i
else
instance.run_mode[:max_retries] = MAX_RETRIES_DEFAULT
end