Attempt to validate top scope provisioner options

This commit is contained in:
Brian Cain 2019-08-06 16:18:58 -07:00
parent e05437ddf2
commit 28c0f6085c
No known key found for this signature in database
GPG Key ID: 9FC4639B2E4510A0
2 changed files with 11 additions and 4 deletions

View File

@ -760,6 +760,13 @@ module VagrantPlugins
next
end
require 'pry'
binding.pry
#provisioner_errors = vm_provisioner.validate(machine)
#if provisioner_errors
# errors = Vagrant::Config::V2::Util.merge_errors(errors, provisioner_errors)
#end
if vm_provisioner.config
provisioner_errors = vm_provisioner.config.validate(machine)
if provisioner_errors

View File

@ -3,7 +3,7 @@ require 'log4r'
module VagrantPlugins
module Kernel_V2
# Represents a single configured provisioner for a VM.
class VagrantConfigProvisioner
class VagrantConfigProvisioner < Vagrant.plugin("2", :config)
# Defaults
VALID_BEFORE_AFTER_TYPES = [:each, :all].freeze
@ -53,7 +53,7 @@ module VagrantPlugins
# @return [String]
attr_accessor :after
def initialize(name, type)
def initialize(name, type, before=nil, after=nil)
@logger = Log4r::Logger.new("vagrant::config::vm::provisioner")
@logger.debug("Provisioner defined: #{name}")
@ -64,8 +64,8 @@ module VagrantPlugins
@preserve_order = false
@run = nil
@type = type
@before = nil
@after = nil
@before = before #these aren't being properly set
@after = after
# Attempt to find the provisioner...
if !Vagrant.plugin("2").manager.provisioners[type]