Fix chef configuration

This commit is contained in:
Mitchell Hashimoto 2011-12-14 23:22:10 -08:00
parent e602af8c3a
commit a23ebf7220
3 changed files with 8 additions and 2 deletions

View File

@ -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

View File

@ -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 == ""

View File

@ -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?