From e0c8fadae43b28702becd1349c52f1d3cf2e3288 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Fri, 18 Jan 2013 12:18:30 -0800 Subject: [PATCH] I can remove the `validate!` method from the v1 root --- lib/vagrant/config/v1/root.rb | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/lib/vagrant/config/v1/root.rb b/lib/vagrant/config/v1/root.rb index 7f561c431..f501a1fb3 100644 --- a/lib/vagrant/config/v1/root.rb +++ b/lib/vagrant/config/v1/root.rb @@ -39,26 +39,6 @@ module Vagrant end end - # Validates the configuration classes of this instance and raises an - # exception if they are invalid. If you are implementing a custom configuration - # class, the method you want to implement is {Base#validate}. This is - # the method that checks all the validation, not one which defines - # validation rules. - def validate!(env) - # Validate each of the configured classes and store the results into - # a hash. - errors = @keys.inject({}) do |container, data| - key, instance = data - recorder = ErrorRecorder.new - instance.validate(env, recorder) - container[key.to_sym] = recorder if !recorder.errors.empty? - container - end - - return if errors.empty? - raise Errors::ConfigValidationFailed, :messages => Util::TemplateRenderer.render("config/validation_failed", :errors => errors) - end - # Returns the internal state of the root object. This is used # by outside classes when merging, and shouldn't be called directly. # Note the strange method name is to attempt to avoid any name