Interrupt when asking to destroy a VM should exit. [GH-1017]

This commit is contained in:
Mitchell Hashimoto 2012-07-11 18:32:51 -07:00
parent a34801588c
commit 2995b6439d
2 changed files with 6 additions and 0 deletions
CHANGELOG.md
plugins/commands/destroy

View File

@ -36,6 +36,8 @@
- FIx issue where puppet would reorder module paths. [GH-964]
- Human-friendly error is raised if there are permission issues when
using SCP to upload files. [GH-924]
- When console input is asked for (destroying a VM, bridged interfaces, etc.),
keystrokes such as ctrl-D and ctrl-C are more gracefully handled. [GH-1017]
## 1.0.3 (May 1, 2012)

View File

@ -32,6 +32,10 @@ module VagrantPlugins
begin
choice = @env.ui.ask(I18n.t("vagrant.commands.destroy.confirmation",
:name => vm.name))
rescue Interrupt
# Ctrl-C was pressed (or SIGINT). We just exit immediately
# with a non-zero exit status.
return 1
rescue Vagrant::Errors::UIExpectsTTY
# We raise a more specific error but one which basically
# means the same thing.