We should verify VirtualBox is detected before looking for the old VM

This commit is contained in:
Mitchell Hashimoto 2012-01-07 17:28:33 -08:00
parent e05bfb7efc
commit cab625c06c
1 changed files with 7 additions and 7 deletions

View File

@ -45,13 +45,6 @@ module Vagrant
@logger.info("VBoxManage path: #{@vboxmanage_path}")
if @uuid
# Verify the VM exists, and if it doesn't, then don't worry
# about it (mark the UUID as nil)
r = raw("showvminfo", @uuid)
raise VMNotFound if r.exit_code != 0
end
# Read and assign the version of VirtualBox we know which
# specific driver to instantiate.
begin
@ -61,6 +54,13 @@ module Vagrant
# error here.
raise Errors::VirtualBoxNotDetected
end
if @uuid
# Verify the VM exists, and if it doesn't, then don't worry
# about it (mark the UUID as nil)
r = raw("showvminfo", @uuid)
raise VMNotFound if r.exit_code != 0
end
end
# This clears the forwarded ports that have been set on the