Add our own DestroyConfirm action

This commit is contained in:
Fabio Rehm 2013-04-18 03:11:36 -03:00
parent ecc127321f
commit 10914d53b0
2 changed files with 19 additions and 2 deletions

View file

@ -5,6 +5,7 @@ require 'vagrant-lxc/action/clear_forwarded_ports'
require 'vagrant-lxc/action/create'
require 'vagrant-lxc/action/created'
require 'vagrant-lxc/action/destroy'
require 'vagrant-lxc/action/destroy_confirm'
require 'vagrant-lxc/action/disconnect'
require 'vagrant-lxc/action/compress_rootfs'
require 'vagrant-lxc/action/forced_halt'
@ -142,8 +143,7 @@ module Vagrant
next
end
# TODO: Implement our own DestroyConfirm
b2.use Vagrant::Action::Builtin::Call, VagrantPlugins::ProviderVirtualBox::Action::DestroyConfirm do |env2, b3|
b2.use Vagrant::Action::Builtin::Call, DestroyConfirm do |env2, b3|
if env2[:result]
b3.use Vagrant::Action::Builtin::ConfigValidate
b3.use Vagrant::Action::Builtin::EnvSet, :force_halt => true

View file

@ -0,0 +1,17 @@
require "vagrant/action/builtin/confirm"
module Vagrant
module LXC
module Action
class DestroyConfirm < Vagrant::Action::Builtin::Confirm
def initialize(app, env)
force_key = :force_confirm_destroy
message = I18n.t("vagrant.commands.destroy.confirmation",
:name => env[:machine].name)
super(app, env, message, force_key)
end
end
end
end
end