Make sure a driver is always set on a VM object
This commit is contained in:
parent
97cf6ddfba
commit
40901dc2e6
|
@ -128,10 +128,12 @@ module Vagrant
|
||||||
begin
|
begin
|
||||||
@driver = Driver::VirtualBox.new(@uuid)
|
@driver = Driver::VirtualBox.new(@uuid)
|
||||||
rescue Driver::VirtualBox::VMNotFound
|
rescue Driver::VirtualBox::VMNotFound
|
||||||
# Clear the UUID since this VM doesn't exist. Note that this calls
|
# Clear the UUID since this VM doesn't exist.
|
||||||
# back into `reload!` but shouldn't ever result in infinite
|
|
||||||
# recursion since `@uuid` will be nil.
|
|
||||||
@uuid = nil
|
@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
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue