Move exception raising back into retryable block in VirtualBox driver command execution

By moving the exception throwing back into the retryable block it actually enables the retryable to function properly by retrying, if appropriate, when an certain exception is raised.
This commit is contained in:
Tomdarkness 2013-10-11 18:32:54 +01:00
parent 687ebbfe88
commit 27c7243219
1 changed files with 11 additions and 11 deletions

View File

@ -284,10 +284,10 @@ module VagrantPlugins
# Variable to store our execution result # Variable to store our execution result
r = nil r = nil
# If there is an error with VBoxManage, this gets set to true
errored = false
retryable(:on => Vagrant::Errors::VBoxManageError, :tries => tries, :sleep => 1) do retryable(:on => Vagrant::Errors::VBoxManageError, :tries => tries, :sleep => 1) do
# If there is an error with VBoxManage, this gets set to true
errored = false
# Execute the command # Execute the command
r = raw(*command, &block) r = raw(*command, &block)
@ -322,14 +322,14 @@ module VagrantPlugins
errored = true errored = true
end end
end end
end
# If there was an error running VBoxManage, show the error and the
# If there was an error running VBoxManage, show the error and the # output.
# output. if errored
if errored raise Vagrant::Errors::VBoxManageError,
raise Vagrant::Errors::VBoxManageError, :command => command.inspect,
:command => command.inspect, :stderr => r.stderr
:stderr => r.stderr end
end end
# Return the output, making sure to replace any Windows-style # Return the output, making sure to replace any Windows-style