From a0acc571b25625a10f1b8673e2a5fe3d55e93299 Mon Sep 17 00:00:00 2001 From: Fabio Rehm Date: Tue, 11 Mar 2014 20:56:11 -0300 Subject: [PATCH] core: Use HandleBox in case Vagrant 1.5 is in use --- lib/vagrant-backports/utils.rb | 4 ++++ lib/vagrant-lxc/action.rb | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/vagrant-backports/utils.rb b/lib/vagrant-backports/utils.rb index f0de881..096b5fb 100644 --- a/lib/vagrant-backports/utils.rb +++ b/lib/vagrant-backports/utils.rb @@ -4,6 +4,10 @@ module Vagrant def vagrant_1_3_or_later? Gem::Version.new(Vagrant::VERSION) >= Gem::Version.new('1.3.0') end + + def vagrant_1_5_or_later? + Gem::Version.new(Vagrant::VERSION) >= Gem::Version.new('1.5.0') + end end end end diff --git a/lib/vagrant-lxc/action.rb b/lib/vagrant-lxc/action.rb index d0075e4..d66170e 100644 --- a/lib/vagrant-lxc/action.rb +++ b/lib/vagrant-lxc/action.rb @@ -23,6 +23,9 @@ require 'vagrant-lxc/action/warn_networks' unless Vagrant::Backports.vagrant_1_3_or_later? require 'vagrant-backports/action/wait_for_communicator' end +unless Vagrant::Backports.vagrant_1_5_or_later? + require 'vagrant-backports/action/handle_box' +end module Vagrant module LXC @@ -108,7 +111,7 @@ module Vagrant b.use Builtin::Call, Created do |env, b2| # If the VM is NOT created yet, then do the setup steps if !env[:result] - b2.use Builtin::HandleBoxUrl + b2.use Builtin::HandleBox b2.use HandleBoxMetadata b2.use Create end