Skip to content

Commit

Permalink
providers/virtualbox: catch subprocess launch error [GH-1483]
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchellh committed Jul 6, 2015
1 parent 28a4212 commit 36fa04f
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Expand Up @@ -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]
Expand Down
4 changes: 4 additions & 0 deletions lib/vagrant/errors.rb
Expand Up @@ -720,6 +720,10 @@ class VBoxManageError < VagrantError
error_key(:vboxmanage_error)
end

class VBoxManageLaunchError < VagrantError
error_key(:vboxmanage_launch_error)
end

class VBoxManageNotFoundError < VagrantError
error_key(:vboxmanage_not_found_error)
end
Expand Down
3 changes: 3 additions & 0 deletions plugins/providers/virtualbox/driver/base.rb
Expand Up @@ -403,6 +403,9 @@ def raw(*command, &block)
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
Expand Down
9 changes: 8 additions & 1 deletion templates/locales/en.yml
Expand Up @@ -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
Expand Down Expand Up @@ -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}"
Expand Down

0 comments on commit 36fa04f

Please sign in to comment.