From 40901dc2e6b09a9fc1a71a3f3f49876eeb3000cf Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Mon, 5 Mar 2012 20:42:55 -0800 Subject: [PATCH] Make sure a driver is always set on a VM object --- lib/vagrant/vm.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/vagrant/vm.rb b/lib/vagrant/vm.rb index 2959a881b..22fc6d6cf 100644 --- a/lib/vagrant/vm.rb +++ b/lib/vagrant/vm.rb @@ -128,10 +128,12 @@ module Vagrant begin @driver = Driver::VirtualBox.new(@uuid) rescue Driver::VirtualBox::VMNotFound - # Clear the UUID since this VM doesn't exist. Note that this calls - # back into `reload!` but shouldn't ever result in infinite - # recursion since `@uuid` will be nil. + # Clear the UUID since this VM doesn't exist. @uuid = nil + + # Reset the driver. This shouldn't raise a VMNotFound since we won't + # feed it a UUID. + @driver = Driver::VirtualBox.new end end