Error properly if an invalid VM name is given

This commit is contained in:
Mitchell Hashimoto 2010-05-16 17:46:20 -07:00
parent 709c50e7b6
commit dec46235cb
2 changed files with 3 additions and 1 deletions

View File

@ -46,7 +46,7 @@ module Vagrant
else
# Try to get the vm based on the name. If the specified VM
# doesn't exist, then error saying so
vm = env.vms[vm.to_sym]
vm = env.vms[vm.to_sym] || error_and_exit(:unknown_vm, :vm => vm)
end
show_single(vm)

View File

@ -154,6 +154,8 @@
:system_unspecified: |-
A VM system type must be specified! This is done via the `config.vm.system`
configuration value. Please read the documentation online for more information.
:unknown_vm: |-
The specified VM could not be found: <%= vm %>
:virtualbox_import_failure: |-
The VM import failed! Try running `VBoxManage import` on the box file
manually for more verbose error output.