diff --git a/lib/vagrant-lxc/action.rb b/lib/vagrant-lxc/action.rb index 1967595..8a592d3 100644 --- a/lib/vagrant-lxc/action.rb +++ b/lib/vagrant-lxc/action.rb @@ -40,7 +40,6 @@ module Vagrant end end - # This action boots the VM, assuming the VM is in a state that requires # a bootup (i.e. not saved). def self.action_boot @@ -146,6 +145,9 @@ module Vagrant b3.use Vagrant::Action::Builtin::EnvSet, :force_halt => true b3.use action_halt b3.use Destroy + if Vagrant::LXC.vagrant_1_3_or_later + b3.use Vagrant::Action::Builtin::ProvisionerCleanup + end else b3.use Message, :will_not_destroy end diff --git a/lib/vagrant-lxc/plugin.rb b/lib/vagrant-lxc/plugin.rb index c3222cc..549a084 100644 --- a/lib/vagrant-lxc/plugin.rb +++ b/lib/vagrant-lxc/plugin.rb @@ -23,5 +23,9 @@ module Vagrant Config end end + + def self.vagrant_1_3_or_later + Gem::Version.new(Vagrant::VERSION) >= Gem::Version.new('1.3.0') + end end end