provisioners/chef: error if knife not found and auto-deleting

This commit is contained in:
Mitchell Hashimoto 2013-08-29 11:36:37 -07:00
parent 0227dd26b1
commit 1ac3fb39fc
2 changed files with 11 additions and 0 deletions

View File

@ -1,5 +1,7 @@
require File.expand_path("../base", __FILE__)
require "vagrant/util/which"
module VagrantPlugins
module Chef
module Config
@ -50,6 +52,12 @@ module VagrantPlugins
errors << I18n.t("vagrant.config.chef.validation_key_path") if \
!validation_key_path
if delete_client || delete_node
if !Vagrant::Util::Which.which("knife")
errors << I18n.t("vagrant.chef_config_knife_not_found")
end
end
{ "chef client provisioner" => errors }
end
end

View File

@ -33,6 +33,9 @@ en:
stdout: %{stdout}
stderr: %{stderr}
chef_config_knife_not_found: |-
The `knife` application was not found! This is required by Vagrant
to automatically delete Chef nodes and clients.
chef_run_list_empty: |-
Warning: Chef solo run list is empty. This may not be what you want.
provisioner_cleanup: |-