Use vagrant 1.3+ ProvisionerCleanup builtin action on destroy

This commit is contained in:
Fabio Rehm 2013-09-11 21:51:18 -03:00
parent 2064dbf05a
commit f13806626c
2 changed files with 7 additions and 1 deletions

View file

@ -40,7 +40,6 @@ module Vagrant
end end
end end
# This action boots the VM, assuming the VM is in a state that requires # This action boots the VM, assuming the VM is in a state that requires
# a bootup (i.e. not saved). # a bootup (i.e. not saved).
def self.action_boot def self.action_boot
@ -146,6 +145,9 @@ module Vagrant
b3.use Vagrant::Action::Builtin::EnvSet, :force_halt => true b3.use Vagrant::Action::Builtin::EnvSet, :force_halt => true
b3.use action_halt b3.use action_halt
b3.use Destroy b3.use Destroy
if Vagrant::LXC.vagrant_1_3_or_later
b3.use Vagrant::Action::Builtin::ProvisionerCleanup
end
else else
b3.use Message, :will_not_destroy b3.use Message, :will_not_destroy
end end

View file

@ -23,5 +23,9 @@ module Vagrant
Config Config
end end
end end
def self.vagrant_1_3_or_later
Gem::Version.new(Vagrant::VERSION) >= Gem::Version.new('1.3.0')
end
end end
end end