Error if :vagrant is used as chef JSON key. [GH-661]

This commit is contained in:
Mitchell Hashimoto 2012-01-19 19:48:57 -08:00
parent 89fb684297
commit ac48d270eb
3 changed files with 11 additions and 1 deletions

View File

@ -8,6 +8,8 @@
determining VirtualBox version. [GH-658]
- Debian/Ubuntu uses `ifdown` again, instead of `ifconfig xxx down`, since
the behavior seems different/wrong.
- Give a nice error if `:vagrant` is used as a JSON key, since Vagrant
uses this. [GH-661]
## 0.9.1 (January 18, 2012)

View File

@ -147,6 +147,12 @@ module Vagrant
run_list << name
end
def validate(env, errors)
super
errors.add(I18n.t("vagrant.config.chef.vagrant_as_json_key")) if @json.has_key?(:vagrant)
end
def instance_variables_hash
# Overridden so that the 'json' key could be removed, since its just
# merged into the config anyways

View File

@ -188,9 +188,11 @@ en:
common:
error_empty: "`%{field}` must be filled in."
chef:
run_list_empty: "Run list must not be empty."
cookbooks_path_empty: "Must specify a cookbooks path for chef solo."
run_list_empty: "Run list must not be empty."
server_url_empty: "Chef server URL must be populated."
vagrant_as_json_key: |-
`vagrant` cannot be a JSON key, because it is used by Vagrant already.
validation_key_path: "Validation key path must be valid path to your chef server validation key."
ssh:
private_key_missing: "`private_key_path` file must exist: %{path}"