summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2018-09-25 14:44:36 -0700
committerGitHub <noreply@github.com>2018-09-25 14:44:36 -0700
commit58a53ca314e1fce294b26c1a7421b673c12708d9 (patch)
treed9faf8913263d183c34d04e7db08aecfcf4ded6e
parent1cbfaa27bc48ae427d9a27532f430cfef557c8dc (diff)
parent69cfeaa3b1d965296c9b683df66e7b08d52fd523 (diff)
downloadchef-58a53ca314e1fce294b26c1a7421b673c12708d9.tar.gz
Merge pull request #7686 from chef/better_error
Improve the error message when knife bootstrap windows isn't installed
-rw-r--r--lib/chef/knife/bootstrap.rb12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/chef/knife/bootstrap.rb b/lib/chef/knife/bootstrap.rb
index 9decacce13..ae01a73c37 100644
--- a/lib/chef/knife/bootstrap.rb
+++ b/lib/chef/knife/bootstrap.rb
@@ -420,10 +420,11 @@ class Chef
exit 1
elsif server_name == "windows"
# catches "knife bootstrap windows" when that command is not installed
- ui.warn("Hostname containing 'windows' specified. Please install 'knife-windows' if you are attempting to bootstrap a Windows node via WinRM.")
+ ui.warn("'knife bootstrap windows' specified, but the knife-windows plugin is not installed. Please install 'knife-windows' if you are attempting to bootstrap a Windows node via WinRM.")
end
end
+ # make sure policyfile values are set correctly
def validate_options!
if incomplete_policyfile_options?
ui.error("--policy-name and --policy-group must be specified together")
@@ -435,6 +436,9 @@ class Chef
true
end
+ # setup a Chef::Knife::Ssh object using the passed config options
+ #
+ # @return Chef::Knife::Ssh
def knife_ssh
ssh = Chef::Knife::Ssh.new
ssh.ui = ui
@@ -452,6 +456,10 @@ class Chef
ssh
end
+ # prompt for a password then return a knife ssh object with that password set
+ # and with ssh_identity_file set to nil
+ #
+ # @return Chef::Knife::Ssh
def knife_ssh_with_password_auth
ssh = knife_ssh
ssh.config[:ssh_identity_file] = nil
@@ -459,6 +467,8 @@ class Chef
ssh
end
+ # build the ssh dommand for bootrapping
+ # @return String
def ssh_command
command = render_template