providers/virtualbox: catch subprocess launch error [GH-1483]

This commit is contained in:
Mitchell Hashimoto 2015-07-05 17:01:06 -07:00
parent 28a42122b8
commit 36fa04fd1e
4 changed files with 17 additions and 1 deletions

View File

@ -75,6 +75,8 @@ BUG FIXES:
- providers/hyperv: only set EFI secure boot for gen 2 machines [GH-5538]
- providers/virtualbox: read netmask from dhcpservers [GH-5233]
- providers/virtualbox: Fix exception when VirtualBox version is empty. [GH-5308]
- providers/virtualbox: Fix exception when VBoxManage.exe can't be run
on Windows [GH-1483]
- provisioners/ansible: fix SSH settings to support more than 5 ssh keys [GH-5017]
- provisioners/ansible: increase ansible connection timeout to 30 seconds [GH-5018]
- provisioners/ansible: disable color if Vagrant is not colored [GH-5531, GH-5532]

View File

@ -720,6 +720,10 @@ module Vagrant
error_key(:vboxmanage_error)
end
class VBoxManageLaunchError < VagrantError
error_key(:vboxmanage_launch_error)
end
class VBoxManageNotFoundError < VagrantError
error_key(:vboxmanage_not_found_error)
end

View File

@ -403,6 +403,9 @@ module VagrantPlugins
Vagrant::Util::Busy.busy(int_callback) do
Vagrant::Util::Subprocess.execute(@vboxmanage_path, *command, &block)
end
rescue Vagrant::Util::Subprocess::LaunchError => e
raise Vagrant::Errors::VBoxManageLaunchError,
message: e.to_s
end
end
end

View File

@ -1231,6 +1231,13 @@ en:
Command: %{command}
Stderr: %{stderr}
vboxmanage_launch_error: |-
There was an error running VBoxManage. This is usually a permissions
problem or installation problem with VirtualBox itself, and not Vagrant.
Please note the error message below (if any), resolve the issue, and
try Vagrant again.
%{message}
vboxmanage_not_found_error: |-
The "VBoxManage" command or one of its dependencies could not
be found. Please verify VirtualBox is properly installed. You can verify
@ -1863,7 +1870,7 @@ en:
%{manifest}
environment_missing: |-
The configured Puppet environment folder %{environment} was not found in the
The configured Puppet environment folder %{environment} was not found in the
specified environmentpath %{environmentpath}.
Please specify a path to an existing Puppet directory environment.
environment_path_missing: "The environment path specified for Puppet does not exist: %{path}"