From a23ebf7220e895d9ed4e6f66098735ce4855b32e Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Wed, 14 Dec 2011 23:22:10 -0800 Subject: [PATCH] Fix chef configuration --- lib/vagrant/config/vm/provisioner.rb | 6 ++++++ lib/vagrant/provisioners/chef_client.rb | 2 +- lib/vagrant/provisioners/chef_solo.rb | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/vagrant/config/vm/provisioner.rb b/lib/vagrant/config/vm/provisioner.rb index eb996208b..d064c4637 100644 --- a/lib/vagrant/config/vm/provisioner.rb +++ b/lib/vagrant/config/vm/provisioner.rb @@ -1,3 +1,5 @@ +require 'log4r' + module Vagrant module Config class VMConfig < Base @@ -8,11 +10,14 @@ module Vagrant attr_reader :config def initialize(shortcut, options=nil, &block) + @logger = Log4r::Logger.new("vagrant::config::vm::provisioner") + @logger.debug("Provisioner config: #{shortcut}") @shortcut = shortcut @provisioner = shortcut @provisioner = Vagrant.provisioners.get(shortcut) if shortcut.is_a?(Symbol) @config = nil + @logger.info("Provisioner class: #{provisioner}") configure(options, &block) if @provisioner end @@ -21,6 +26,7 @@ module Vagrant config_class = @provisioner.config_class return if !config_class + @logger.debug("Configuring provisioner with: #{config_class}") @config = config_class.new @config.set_options(options) if options block.call(@config) if block diff --git a/lib/vagrant/provisioners/chef_client.rb b/lib/vagrant/provisioners/chef_client.rb index 7ced20e33..9c0620a02 100644 --- a/lib/vagrant/provisioners/chef_client.rb +++ b/lib/vagrant/provisioners/chef_client.rb @@ -29,7 +29,7 @@ module Vagrant @encrypted_data_bag_secret = "/tmp/encrypted_data_bag_secret" end - def validate(errors) + def validate(env, errors) super errors.add(I18n.t("vagrant.config.chef.server_url_empty")) if !chef_server_url || chef_server_url.strip == "" diff --git a/lib/vagrant/provisioners/chef_solo.rb b/lib/vagrant/provisioners/chef_solo.rb index 295aec97b..931a59d4d 100644 --- a/lib/vagrant/provisioners/chef_solo.rb +++ b/lib/vagrant/provisioners/chef_solo.rb @@ -23,7 +23,7 @@ module Vagrant @nfs = false end - def validate(errors) + def validate(env, errors) super errors.add(I18n.t("vagrant.config.chef.cookbooks_path_empty")) if !cookbooks_path || [cookbooks_path].flatten.empty?