Use the proper config version in config.vm.define calls
This commit is contained in:
parent
bb97351060
commit
9156be0f84
|
@ -75,6 +75,10 @@ module VagrantPlugins
|
|||
end
|
||||
|
||||
def define(name, options=nil, &block)
|
||||
# Force the V1 config on these calls
|
||||
options ||= {}
|
||||
options[:config_version] = "1"
|
||||
|
||||
@define_calls << [name, options, block]
|
||||
end
|
||||
|
||||
|
|
|
@ -115,6 +115,7 @@ module VagrantPlugins
|
|||
def define(name, options=nil, &block)
|
||||
name = name.to_sym
|
||||
options ||= {}
|
||||
options[:config_version] ||= "2"
|
||||
|
||||
# Add the name to the array of VM keys. This array is used to
|
||||
# preserve the order in which VMs are defined.
|
||||
|
@ -126,7 +127,7 @@ module VagrantPlugins
|
|||
end
|
||||
|
||||
defined_vms[name].options.merge!(options)
|
||||
defined_vms[name].push_proc(&block) if block
|
||||
defined_vms[name].config_procs << [options[:config_version], block] if block
|
||||
end
|
||||
|
||||
def finalize!
|
||||
|
|
|
@ -6,20 +6,17 @@ module VagrantPlugins
|
|||
class VagrantConfigSubVM
|
||||
include Vagrant::Util::StackedProcRunner
|
||||
|
||||
# Returns an array of the configuration procs in [version, proc]
|
||||
# format.
|
||||
#
|
||||
# @return [Array]
|
||||
attr_reader :config_procs
|
||||
|
||||
attr_reader :options
|
||||
|
||||
def initialize
|
||||
@options = {}
|
||||
end
|
||||
|
||||
# This returns an array of the procs to configure this VM, with
|
||||
# the proper version pre-pended for the configuration loader.
|
||||
#
|
||||
# @return [Array]
|
||||
def config_procs
|
||||
proc_stack.map do |proc|
|
||||
["2", proc]
|
||||
end
|
||||
@config_procs = []
|
||||
@options = {}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue