Permalink
Browse files

Make sure a driver is always set on a VM object

  • Loading branch information...
1 parent 97cf6dd commit 40901dc2e6b09a9fc1a71a3f3f49876eeb3000cf @mitchellh mitchellh committed Mar 6, 2012
Showing with 5 additions and 3 deletions.
  1. +5 −3 lib/vagrant/vm.rb
View
@@ -128,10 +128,12 @@ def reload!
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

0 comments on commit 40901dc

Please sign in to comment.