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

This commit is contained in:
Alejandro Huertas Herrero authored and Tino Vázquez committed 2019-02-27 17:32:33 +01:00
1 parent bb3db27bec
commit 3297dd48fc
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