More accurate VBoxManage error detection.

This commit is contained in:
Mitchell Hashimoto 2012-01-27 12:40:42 -08:00
parent e1dbc7f9b1
commit 6d7a3d9b64
2 changed files with 9 additions and 0 deletions

View File

@ -13,6 +13,7 @@
- Fix issue where VM import sometimes made strange VirtualBox folder - Fix issue where VM import sometimes made strange VirtualBox folder
layouts. [GH-669] layouts. [GH-669]
- Call proper `id` command on Solaris. [GH-679] - Call proper `id` command on Solaris. [GH-679]
- More accurate VBoxManage error detection.
## 0.9.3 (January 24, 2012) ## 0.9.3 (January 24, 2012)

View File

@ -260,6 +260,14 @@ module Vagrant
else else
raise Errors::VBoxManageError, :command => command.inspect raise Errors::VBoxManageError, :command => command.inspect
end end
else
# Sometimes, VBoxManage fails but doesn't actual return a non-zero
# exit code. For this we inspect the output and determine if an error
# occurred.
if r.stderr =~ /VBoxManage: error:/
@logger.info("VBoxManage error text found, assuming error.")
raise Errors::VBoxManageError, :command => command.inspect
end
end end
# Return the output, making sure to replace any Windows-style # Return the output, making sure to replace any Windows-style