From 27c7243219d001e513ba1d6f4277bdc030e04673 Mon Sep 17 00:00:00 2001 From: Tomdarkness Date: Fri, 11 Oct 2013 18:32:54 +0100 Subject: [PATCH] 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. --- plugins/providers/virtualbox/driver/base.rb | 22 ++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/plugins/providers/virtualbox/driver/base.rb b/plugins/providers/virtualbox/driver/base.rb index 3812cfb8d..d06898b2d 100644 --- a/plugins/providers/virtualbox/driver/base.rb +++ b/plugins/providers/virtualbox/driver/base.rb @@ -284,10 +284,10 @@ module VagrantPlugins # Variable to store our execution result 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 + # If there is an error with VBoxManage, this gets set to true + errored = false + # Execute the command r = raw(*command, &block) @@ -322,14 +322,14 @@ module VagrantPlugins errored = true end end - end - - # If there was an error running VBoxManage, show the error and the - # output. - if errored - raise Vagrant::Errors::VBoxManageError, - :command => command.inspect, - :stderr => r.stderr + + # If there was an error running VBoxManage, show the error and the + # output. + if errored + raise Vagrant::Errors::VBoxManageError, + :command => command.inspect, + :stderr => r.stderr + end end # Return the output, making sure to replace any Windows-style