Fix overzealous errors with chef solo provisioner defaults
This commit is contained in:
parent
5ad6c2a94a
commit
59282ba999
|
@ -1,6 +1,9 @@
|
||||||
## 1.1.2 (unreleased)
|
## 1.1.2 (unreleased)
|
||||||
|
|
||||||
|
BUG FIXES:
|
||||||
|
|
||||||
|
- When not specifying a cookbooks_path for chef-solo, an error won't
|
||||||
|
be shown if "cookbooks" folder is missing.
|
||||||
|
|
||||||
## 1.1.1 (March 18, 2013)
|
## 1.1.1 (March 18, 2013)
|
||||||
|
|
||||||
|
|
|
@ -22,11 +22,14 @@ module VagrantPlugins
|
||||||
@encrypted_data_bag_secret = UNSET_VALUE
|
@encrypted_data_bag_secret = UNSET_VALUE
|
||||||
@encrypted_data_bag_secret_key_path = UNSET_VALUE
|
@encrypted_data_bag_secret_key_path = UNSET_VALUE
|
||||||
@nfs = UNSET_VALUE
|
@nfs = UNSET_VALUE
|
||||||
|
|
||||||
|
@__defaulted_cookbooks_path = false
|
||||||
end
|
end
|
||||||
|
|
||||||
def finalize!
|
def finalize!
|
||||||
if @cookbooks_path == UNSET_VALUE
|
if @cookbooks_path == UNSET_VALUE
|
||||||
@cookbooks_path = [[:host, "cookbooks"], [:vm, "cookbooks"]]
|
@cookbooks_path = [[:host, "cookbooks"], [:vm, "cookbooks"]]
|
||||||
|
@__defaulted_cookbooks_path = true
|
||||||
end
|
end
|
||||||
|
|
||||||
@data_bags_path = [] if @data_bags_path == UNSET_VALUE
|
@data_bags_path = [] if @data_bags_path == UNSET_VALUE
|
||||||
|
@ -52,6 +55,7 @@ module VagrantPlugins
|
||||||
errors << I18n.t("vagrant.config.chef.run_list_empty") if \
|
errors << I18n.t("vagrant.config.chef.run_list_empty") if \
|
||||||
!run_list || run_list.empty?
|
!run_list || run_list.empty?
|
||||||
|
|
||||||
|
if !@__defaulted_cookbooks_path
|
||||||
@cookbooks_path.each do |type, path|
|
@cookbooks_path.each do |type, path|
|
||||||
next if type != :host
|
next if type != :host
|
||||||
expanded_path = File.expand_path(path, machine.env.root_path)
|
expanded_path = File.expand_path(path, machine.env.root_path)
|
||||||
|
@ -61,6 +65,7 @@ module VagrantPlugins
|
||||||
:path => expanded_path)
|
:path => expanded_path)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
{ "chef solo provisioner" => errors }
|
{ "chef solo provisioner" => errors }
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue