Require at least Vagrant 1.2.x in Vagrantfile
Users don't read READMEs or documentation, they'll just fire 'vagrant up'. Vagrant already checks the Virtualbox version itself, but for the Vagrant version no checks exist. Vagrant 1.4 provides a method 'require_version' which is pretty useless for older versions, like on Debian Wheezy (1.0.3). So we'll ship our own version comparison. fixes #6366
This commit is contained in:
parent
324a4c973d
commit
31f4c9b1b2
|
@ -1,7 +1,20 @@
|
|||
# -*- mode: ruby -*-
|
||||
# vi: set ft=ruby :
|
||||
|
||||
Vagrant.configure("2") do |config|
|
||||
VAGRANTFILE_API_VERSION = "2"
|
||||
VAGRANT_REQUIRED_VERSION = "1.2.0"
|
||||
|
||||
# Require 1.2.x at least
|
||||
if ! defined? Vagrant.require_version
|
||||
if Gem::Version.new(Vagrant::VERSION) < Gem::Version.new(VAGRANT_REQUIRED_VERSION)
|
||||
puts "Vagrant >= " + VAGRANT_REQUIRED_VERSION + " required. Your version is " + Vagrant::VERSION
|
||||
exit 1
|
||||
end
|
||||
else
|
||||
Vagrant.require_version ">= " + VAGRANT_REQUIRED_VERSION
|
||||
end
|
||||
|
||||
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
||||
# All Vagrant configuration is done here. The most common configuration
|
||||
# options are documented and commented below. For a complete reference,
|
||||
# please see the online documentation at vagrantup.com.
|
||||
|
|
Loading…
Reference in New Issue