Sha256: f963a17a3fc66eb3f43969b7c263a6e0ccf0ee32e3c6c7492bf85ee5593f294d

Contents?: true

Size: 793 Bytes

Versions: 20

Compression:

Stored size: 793 Bytes

Contents

require "vagrant/util/template_renderer"

module Vagrant
  module Action
    module Builtin
      # This class validates the configuration and raises an exception
      # if there are any validation errors.
      class ConfigValidate
        def initialize(app, env)
          @app = app
        end

        def call(env)
          if !env.key?(:config_validate) || env[:config_validate]
            errors = env[:machine].config.validate(env[:machine], env[:ignore_provider])

            if errors && !errors.empty?
              raise Errors::ConfigInvalid,
                errors: Util::TemplateRenderer.render(
                  "config/validation_failed",
                  errors: errors)
            end
          end

          @app.call(env)
        end
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 3 rubygems

Version Path
vagrant-unbundled-2.3.6.0 lib/vagrant/action/builtin/config_validate.rb
tamtam-vagrant-reload-1.2.1 vendor/cache/vagrant-2092df529ae7/lib/vagrant/action/builtin/config_validate.rb
vagrant-unbundled-2.3.3.0 lib/vagrant/action/builtin/config_validate.rb
vagrant-unbundled-2.3.2.0 lib/vagrant/action/builtin/config_validate.rb
vagrant-unbundled-2.2.19.0 lib/vagrant/action/builtin/config_validate.rb
vagrant-unbundled-2.2.18.0 lib/vagrant/action/builtin/config_validate.rb
vagrant-unbundled-2.2.16.0 lib/vagrant/action/builtin/config_validate.rb
vagrant-unbundled-2.2.14.0 lib/vagrant/action/builtin/config_validate.rb
vagrant-aws-mkubenka-0.7.2.pre.24 vendor/bundle/ruby/2.7.0/bundler/gems/vagrant-22795b161bf6/lib/vagrant/action/builtin/config_validate.rb
vagrant-unbundled-2.2.10.0 lib/vagrant/action/builtin/config_validate.rb
vagrant-unbundled-2.2.9.0 lib/vagrant/action/builtin/config_validate.rb
vagrant-unbundled-2.2.8.0 lib/vagrant/action/builtin/config_validate.rb
vagrant-unbundled-2.2.7.0 lib/vagrant/action/builtin/config_validate.rb
vagrant-unbundled-2.2.6.2 lib/vagrant/action/builtin/config_validate.rb
vagrant-unbundled-2.2.6.1 lib/vagrant/action/builtin/config_validate.rb
vagrant-unbundled-2.2.6.0 lib/vagrant/action/builtin/config_validate.rb
vagrant-unbundled-2.2.5.0 lib/vagrant/action/builtin/config_validate.rb
vagrant-unbundled-2.2.4.0 lib/vagrant/action/builtin/config_validate.rb
vagrant-unbundled-2.2.3.0 lib/vagrant/action/builtin/config_validate.rb
vagrant-unbundled-2.2.2.0 lib/vagrant/action/builtin/config_validate.rb