provisioners/chef: validate environments path [GH-2381]

This commit is contained in:
Mitchell Hashimoto 2013-11-26 18:57:27 -08:00
parent 9a1001cbf5
commit 798432febe
3 changed files with 16 additions and 1 deletions

View File

@ -78,6 +78,8 @@ BUG FIXES:
failure during `up` from suspended. [GH-2479]
- provisioners/chef: Chef client encrypted data bag secrets are now
uploaded to the provisioning path to avoid perm issues. [GH-1246]
- provisioners/chef: Verify environment paths exist in config
validation step. [GH-2381]
- provisioners/salt: Bootstrap on FreeBSD systems work. [GH-2525]
## 1.3.5 (October 15, 2013)

View File

@ -70,6 +70,16 @@ module VagrantPlugins
errors << I18n.t("vagrant.config.chef.environment_path_required") if \
environment && environments_path.empty?
{ "chef solo provisioner" => errors }
environments_path.each do |type, raw_path|
next if type != :host
path = Pathname.new(raw_path).expand_path(machine.env.root_path)
if !path.directory?j
errors << I18n.t("vagrant.config.chef.environment_path_missing",
path: raw_path.to_s)
end
end
end
protected

View File

@ -699,7 +699,10 @@ en:
error_empty: "`%{field}` must be not be empty."
chef:
cookbooks_path_empty: "Must specify a cookbooks path for chef solo."
environment_path_required: "When 'environment' is specified, you must provide 'environments_path'."
environment_path_missing: |-
Environment path not found: %{path}
environment_path_required: |-
When 'environment' is specified, you must provide 'environments_path'.
cookbooks_path_missing: |-
Cookbook path doesn't exist: %{path}
custom_config_path_missing: |-