Merge pull request #587 from infernix/fix-version-test

Move version sanity check to vagrant-libvirt.rb
This commit is contained in:
Gerben Meijer 2016-04-26 11:20:07 +02:00
commit 6b687efa6d
2 changed files with 12 additions and 6 deletions

View File

@ -13,5 +13,17 @@ module VagrantPlugins
end
end
begin
require 'vagrant'
rescue LoadError
raise 'The Vagrant Libvirt plugin must be run within Vagrant.'
end
# This is a sanity check to make sure no one is attempting to install
# this into an early Vagrant version.
if Vagrant::VERSION < '1.5.0'
raise 'The Vagrant Libvirt plugin is only compatible with Vagrant 1.5+'
end
# make sure base module class defined before loading plugin
require 'vagrant-libvirt/plugin'

View File

@ -4,12 +4,6 @@ rescue LoadError
raise 'The Vagrant Libvirt plugin must be run within Vagrant.'
end
# This is a sanity check to make sure no one is attempting to install
# this into an early Vagrant version.
if Vagrant::VERSION < '1.5.0'
raise 'The Vagrant Libvirt plugin is only compatible with Vagrant 1.5+'
end
# compatibility fix to define constant not available vagrant <1.6
::Vagrant::MachineState::NOT_CREATED_ID ||= :not_created