diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2018-07-02 10:27:03 -0700 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2018-07-02 10:27:03 -0700 |
commit | dcac6762380d011f73cf53a50476d31dab0025ee (patch) | |
tree | 294fef3e2b4fea273c4bb11a086061872ed51598 /lib/chef/knife | |
parent | 35603c7ce1bd3ccf35334ed65152140f0ecaf080 (diff) | |
download | chef-dcac6762380d011f73cf53a50476d31dab0025ee.tar.gz |
fix Layout/IndentHeredoc
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'lib/chef/knife')
-rw-r--r-- | lib/chef/knife/configure.rb | 10 | ||||
-rw-r--r-- | lib/chef/knife/cookbook_upload.rb | 12 | ||||
-rw-r--r-- | lib/chef/knife/core/bootstrap_context.rb | 6 | ||||
-rw-r--r-- | lib/chef/knife/core/node_presenter.rb | 54 | ||||
-rw-r--r-- | lib/chef/knife/key_create.rb | 8 | ||||
-rw-r--r-- | lib/chef/knife/key_edit.rb | 10 | ||||
-rw-r--r-- | lib/chef/knife/key_list.rb | 6 | ||||
-rw-r--r-- | lib/chef/knife/ssl_check.rb | 94 | ||||
-rw-r--r-- | lib/chef/knife/ssl_fetch.rb | 14 | ||||
-rw-r--r-- | lib/chef/knife/user_create.rb | 22 | ||||
-rw-r--r-- | lib/chef/knife/user_delete.rb | 18 | ||||
-rw-r--r-- | lib/chef/knife/user_edit.rb | 18 | ||||
-rw-r--r-- | lib/chef/knife/user_reregister.rb | 18 | ||||
-rw-r--r-- | lib/chef/knife/user_show.rb | 18 |
14 files changed, 154 insertions, 154 deletions
diff --git a/lib/chef/knife/configure.rb b/lib/chef/knife/configure.rb index fb2954c982..4b33998eaa 100644 --- a/lib/chef/knife/configure.rb +++ b/lib/chef/knife/configure.rb @@ -75,11 +75,11 @@ class Chef confirm("Overwrite #{config_file_path}") if ::File.exist?(config_file_path) ::File.open(config_file_path, "w") do |f| - f.puts <<-EOH -[default] -client_name = '#{new_client_name}' -client_key = '#{new_client_key}' -chef_server_url = '#{chef_server}' + f.puts <<~EOH + [default] + client_name = '#{new_client_name}' + client_key = '#{new_client_key}' + chef_server_url = '#{chef_server}' EOH end diff --git a/lib/chef/knife/cookbook_upload.rb b/lib/chef/knife/cookbook_upload.rb index 241eb03862..854945bf5f 100644 --- a/lib/chef/knife/cookbook_upload.rb +++ b/lib/chef/knife/cookbook_upload.rb @@ -209,12 +209,12 @@ class Chef unless cookbook_repo.merged_cookbooks.empty? ui.warn "* " * 40 - ui.warn(<<-WARNING) -The cookbooks: #{cookbook_repo.merged_cookbooks.join(', ')} exist in multiple places in your cookbook_path. -A composite version of these cookbooks has been compiled for uploading. - -#{ui.color('IMPORTANT:', :red, :bold)} In a future version of Chef, this behavior will be removed and you will no longer -be able to have the same version of a cookbook in multiple places in your cookbook_path. + ui.warn(<<~WARNING) + The cookbooks: #{cookbook_repo.merged_cookbooks.join(', ')} exist in multiple places in your cookbook_path. + A composite version of these cookbooks has been compiled for uploading. + + #{ui.color('IMPORTANT:', :red, :bold)} In a future version of Chef, this behavior will be removed and you will no longer + be able to have the same version of a cookbook in multiple places in your cookbook_path. WARNING ui.warn "The affected cookbooks are located:" ui.output ui.format_for_display(cookbook_repo.merged_cookbook_paths) diff --git a/lib/chef/knife/core/bootstrap_context.rb b/lib/chef/knife/core/bootstrap_context.rb index 17d62f597f..bb20780590 100644 --- a/lib/chef/knife/core/bootstrap_context.rb +++ b/lib/chef/knife/core/bootstrap_context.rb @@ -86,9 +86,9 @@ class Chef end def config_content - client_rb = <<-CONFIG -chef_server_url "#{@chef_config[:chef_server_url]}" -validation_client_name "#{@chef_config[:validation_client_name]}" + client_rb = <<~CONFIG + chef_server_url "#{@chef_config[:chef_server_url]}" + validation_client_name "#{@chef_config[:validation_client_name]}" CONFIG if !(@chef_config[:config_log_level].nil? || @chef_config[:config_log_level].empty?) diff --git a/lib/chef/knife/core/node_presenter.rb b/lib/chef/knife/core/node_presenter.rb index 0c00601981..7cb0e4d6fe 100644 --- a/lib/chef/knife/core/node_presenter.rb +++ b/lib/chef/knife/core/node_presenter.rb @@ -98,49 +98,49 @@ class Chef # special case ec2 with their split horizon whatsis. ip = (node[:ec2] && node[:ec2][:public_ipv4]) || node[:ipaddress] - summarized = <<-SUMMARY -#{ui.color('Node Name:', :bold)} #{ui.color(node.name, :bold)} + summarized = <<~SUMMARY + #{ui.color('Node Name:', :bold)} #{ui.color(node.name, :bold)} SUMMARY show_policy = !(node.policy_name.nil? && node.policy_group.nil?) if show_policy - summarized << <<-POLICY -#{key('Policy Name:')} #{node.policy_name} -#{key('Policy Group:')} #{node.policy_group} + summarized << <<~POLICY + #{key('Policy Name:')} #{node.policy_name} + #{key('Policy Group:')} #{node.policy_group} POLICY else - summarized << <<-ENV -#{key('Environment:')} #{node.chef_environment} + summarized << <<~ENV + #{key('Environment:')} #{node.chef_environment} ENV end - summarized << <<-SUMMARY -#{key('FQDN:')} #{node[:fqdn]} -#{key('IP:')} #{ip} -#{key('Run List:')} #{node.run_list} + summarized << <<~SUMMARY + #{key('FQDN:')} #{node[:fqdn]} + #{key('IP:')} #{ip} + #{key('Run List:')} #{node.run_list} SUMMARY unless show_policy - summarized << <<-ROLES -#{key('Roles:')} #{Array(node[:roles]).join(', ')} + summarized << <<~ROLES + #{key('Roles:')} #{Array(node[:roles]).join(', ')} ROLES end - summarized << <<-SUMMARY -#{key('Recipes:')} #{Array(node[:recipes]).join(', ')} -#{key('Platform:')} #{node[:platform]} #{node[:platform_version]} -#{key('Tags:')} #{node.tags.join(', ')} + summarized << <<~SUMMARY + #{key('Recipes:')} #{Array(node[:recipes]).join(', ')} + #{key('Platform:')} #{node[:platform]} #{node[:platform_version]} + #{key('Tags:')} #{node.tags.join(', ')} SUMMARY if config[:medium_output] || config[:long_output] - summarized += <<-MORE -#{key('Attributes:')} -#{text_format(node.normal_attrs)} + summarized += <<~MORE + #{key('Attributes:')} + #{text_format(node.normal_attrs)} MORE end if config[:long_output] - summarized += <<-MOST -#{key('Default Attributes:')} -#{text_format(node.default_attrs)} -#{key('Override Attributes:')} -#{text_format(node.override_attrs)} -#{key('Automatic Attributes (Ohai Data):')} -#{text_format(node.automatic_attrs)} + summarized += <<~MOST + #{key('Default Attributes:')} + #{text_format(node.default_attrs)} + #{key('Override Attributes:')} + #{text_format(node.override_attrs)} + #{key('Automatic Attributes (Ohai Data):')} + #{text_format(node.automatic_attrs)} MOST end summarized diff --git a/lib/chef/knife/key_create.rb b/lib/chef/knife/key_create.rb index a9f9da97a7..395bbc4bfd 100644 --- a/lib/chef/knife/key_create.rb +++ b/lib/chef/knife/key_create.rb @@ -40,10 +40,10 @@ class Chef end def public_key_or_key_name_error_msg - <<EOS -You must pass either --public-key or --key-name, or both. -If you only pass --public-key, a key name will be generated from the fingerprint of your key. -If you only pass --key-name, a key pair will be generated by the server. + <<~EOS + You must pass either --public-key or --key-name, or both. + If you only pass --public-key, a key name will be generated from the fingerprint of your key. + If you only pass --key-name, a key pair will be generated by the server. EOS end diff --git a/lib/chef/knife/key_edit.rb b/lib/chef/knife/key_edit.rb index 8490d10fa5..d05ee11d1c 100644 --- a/lib/chef/knife/key_edit.rb +++ b/lib/chef/knife/key_edit.rb @@ -41,11 +41,11 @@ class Chef end def public_key_and_create_key_error_msg - <<EOS -You passed both --public-key and --create-key. Only pass one, or the other, or neither. -Do not pass either if you do not want to change the public_key field of your key. -Pass --public-key if you want to update the public_key field of your key from a specific public key. -Pass --create-key if you want the server to generate a new key and use that to update the public_key field of your key. + <<~EOS + You passed both --public-key and --create-key. Only pass one, or the other, or neither. + Do not pass either if you do not want to change the public_key field of your key. + Pass --public-key if you want to update the public_key field of your key from a specific public key. + Pass --create-key if you want the server to generate a new key and use that to update the public_key field of your key. EOS end diff --git a/lib/chef/knife/key_list.rb b/lib/chef/knife/key_list.rb index 9a820b7a50..9d3a2c0c26 100644 --- a/lib/chef/knife/key_list.rb +++ b/lib/chef/knife/key_list.rb @@ -40,9 +40,9 @@ class Chef end def expired_and_non_expired_msg - <<EOS -You cannot pass both --only-expired and --only-non-expired. -Please pass one or none. + <<~EOS + You cannot pass both --only-expired and --only-non-expired. + Please pass one or none. EOS end diff --git a/lib/chef/knife/ssl_check.rb b/lib/chef/knife/ssl_check.rb index c864ef52ec..e3005711fe 100644 --- a/lib/chef/knife/ssl_check.rb +++ b/lib/chef/knife/ssl_check.rb @@ -151,26 +151,26 @@ class Chef debug_ssl_settings debug_chef_ssl_config - ui.warn(<<-BAD_CERTS) -There are invalid certificates in your trusted_certs_dir. -OpenSSL will not use the following certificates when verifying SSL connections: - -#{cert_debug_msg} - -#{ui.color("TO FIX THESE WARNINGS:", :bold)} - -We are working on documentation for resolving common issues uncovered here. - -* If the certificate is generated by the server, you may try redownloading the -server's certificate. By default, the certificate is stored in the following -location on the host where your chef-server runs: - - /var/opt/opscode/nginx/ca/SERVER_HOSTNAME.crt - -Copy that file to your trusted_certs_dir (currently: #{configuration.trusted_certs_dir}) -using SSH/SCP or some other secure method, then re-run this command to confirm -that the server's certificate is now trusted. - + ui.warn(<<~BAD_CERTS) + There are invalid certificates in your trusted_certs_dir. + OpenSSL will not use the following certificates when verifying SSL connections: + + #{cert_debug_msg} + + #{ui.color("TO FIX THESE WARNINGS:", :bold)} + + We are working on documentation for resolving common issues uncovered here. + + * If the certificate is generated by the server, you may try redownloading the + server's certificate. By default, the certificate is stored in the following + location on the host where your chef-server runs: + + /var/opt/opscode/nginx/ca/SERVER_HOSTNAME.crt + + Copy that file to your trusted_certs_dir (currently: #{configuration.trusted_certs_dir}) + using SSH/SCP or some other secure method, then re-run this command to confirm + that the server's certificate is now trusted. + BAD_CERTS # @TODO: ^ needs URL once documentation is posted. end @@ -184,22 +184,22 @@ BAD_CERTS debug_ssl_settings debug_chef_ssl_config - ui.err(<<-ADVICE) - -#{ui.color("TO FIX THIS ERROR:", :bold)} - -If the server you are connecting to uses a self-signed certificate, you must -configure chef to trust that server's certificate. - -By default, the certificate is stored in the following location on the host -where your chef-server runs: - - /var/opt/opscode/nginx/ca/SERVER_HOSTNAME.crt - -Copy that file to your trusted_certs_dir (currently: #{configuration.trusted_certs_dir}) -using SSH/SCP or some other secure method, then re-run this command to confirm -that the server's certificate is now trusted. - + ui.err(<<~ADVICE) + + #{ui.color("TO FIX THIS ERROR:", :bold)} + + If the server you are connecting to uses a self-signed certificate, you must + configure chef to trust that server's certificate. + + By default, the certificate is stored in the following location on the host + where your chef-server runs: + + /var/opt/opscode/nginx/ca/SERVER_HOSTNAME.crt + + Copy that file to your trusted_certs_dir (currently: #{configuration.trusted_certs_dir}) + using SSH/SCP or some other secure method, then re-run this command to confirm + that the server's certificate is now trusted. + ADVICE end @@ -211,17 +211,17 @@ ADVICE ui.error("You are attempting to connect to: '#{host}'") ui.error("The server's certificate belongs to '#{cn}'") - ui.err(<<-ADVICE) - -#{ui.color("TO FIX THIS ERROR:", :bold)} - -The solution for this issue depends on your networking configuration. If you -are able to connect to this server using the hostname #{cn} -instead of #{host}, then you can resolve this issue by updating chef_server_url -in your configuration file. - -If you are not able to connect to the server using the hostname #{cn} -you will have to update the certificate on the server to use the correct hostname. + ui.err(<<~ADVICE) + + #{ui.color("TO FIX THIS ERROR:", :bold)} + + The solution for this issue depends on your networking configuration. If you + are able to connect to this server using the hostname #{cn} + instead of #{host}, then you can resolve this issue by updating chef_server_url + in your configuration file. + + If you are not able to connect to the server using the hostname #{cn} + you will have to update the certificate on the server to use the correct hostname. ADVICE end diff --git a/lib/chef/knife/ssl_fetch.rb b/lib/chef/knife/ssl_fetch.rb index 98c98d06ae..cc0ad3bbd6 100644 --- a/lib/chef/knife/ssl_fetch.rb +++ b/lib/chef/knife/ssl_fetch.rb @@ -130,13 +130,13 @@ class Chef def run validate_uri - ui.warn(<<-TRUST_TRUST) -Certificates from #{host} will be fetched and placed in your trusted_cert -directory (#{trusted_certs_dir}). - -Knife has no means to verify these are the correct certificates. You should -verify the authenticity of these certificates after downloading. - + ui.warn(<<~TRUST_TRUST) + Certificates from #{host} will be fetched and placed in your trusted_cert + directory (#{trusted_certs_dir}). + + Knife has no means to verify these are the correct certificates. You should + verify the authenticity of these certificates after downloading. + TRUST_TRUST remote_cert_chain.each do |cert| write_cert(cert) diff --git a/lib/chef/knife/user_create.rb b/lib/chef/knife/user_create.rb index 9273f0344d..a1761de979 100644 --- a/lib/chef/knife/user_create.rb +++ b/lib/chef/knife/user_create.rb @@ -69,17 +69,17 @@ class Chef end def osc_11_warning - <<-EOF -IF YOU ARE USING CHEF SERVER 12+, PLEASE FOLLOW THE INSTRUCTIONS UNDER knife user create --help. -You only passed a single argument to knife user create. -For backwards compatibility, when only a single argument is passed, -knife user create assumes you want Open Source 11 Server user creation. -knife user create for Open Source 11 Server is being deprecated. -Open Source 11 Server user commands now live under the knife osc_user namespace. -For backwards compatibility, we will forward this request to knife osc_user create. -If you are using an Open Source 11 Server, please use that command to avoid this warning. -NOTE: Backwards compatibility for Open Source 11 Server in these commands will be removed -in Chef 15 which will be released April 2019. + <<~EOF + IF YOU ARE USING CHEF SERVER 12+, PLEASE FOLLOW THE INSTRUCTIONS UNDER knife user create --help. + You only passed a single argument to knife user create. + For backwards compatibility, when only a single argument is passed, + knife user create assumes you want Open Source 11 Server user creation. + knife user create for Open Source 11 Server is being deprecated. + Open Source 11 Server user commands now live under the knife osc_user namespace. + For backwards compatibility, we will forward this request to knife osc_user create. + If you are using an Open Source 11 Server, please use that command to avoid this warning. + NOTE: Backwards compatibility for Open Source 11 Server in these commands will be removed + in Chef 15 which will be released April 2019. EOF end diff --git a/lib/chef/knife/user_delete.rb b/lib/chef/knife/user_delete.rb index abfb45253e..b0a2ece065 100644 --- a/lib/chef/knife/user_delete.rb +++ b/lib/chef/knife/user_delete.rb @@ -30,15 +30,15 @@ class Chef banner "knife user delete USER (options)" def osc_11_warning - <<-EOF -The Chef Server you are using does not support the username field. -This means it is an Open Source 11 Server. -knife user delete for Open Source 11 Server is being deprecated. -Open Source 11 Server user commands now live under the knife osc_user namespace. -For backwards compatibility, we will forward this request to knife osc_user delete. -If you are using an Open Source 11 Server, please use that command to avoid this warning. -NOTE: Backwards compatibility for Open Source 11 Server in these commands will be removed -in Chef 15 which will be released April 2019. + <<~EOF + The Chef Server you are using does not support the username field. + This means it is an Open Source 11 Server. + knife user delete for Open Source 11 Server is being deprecated. + Open Source 11 Server user commands now live under the knife osc_user namespace. + For backwards compatibility, we will forward this request to knife osc_user delete. + If you are using an Open Source 11 Server, please use that command to avoid this warning. + NOTE: Backwards compatibility for Open Source 11 Server in these commands will be removed + in Chef 15 which will be released April 2019. EOF end diff --git a/lib/chef/knife/user_edit.rb b/lib/chef/knife/user_edit.rb index d184b85a6c..8b89b847a9 100644 --- a/lib/chef/knife/user_edit.rb +++ b/lib/chef/knife/user_edit.rb @@ -30,15 +30,15 @@ class Chef banner "knife user edit USER (options)" def osc_11_warning - <<-EOF -The Chef Server you are using does not support the username field. -This means it is an Open Source 11 Server. -knife user edit for Open Source 11 Server is being deprecated. -Open Source 11 Server user commands now live under the knife oc_user namespace. -For backwards compatibility, we will forward this request to knife osc_user edit. -If you are using an Open Source 11 Server, please use that command to avoid this warning. -NOTE: Backwards compatibility for Open Source 11 Server in these commands will be removed -in Chef 15 which will be released April 2019. + <<~EOF + The Chef Server you are using does not support the username field. + This means it is an Open Source 11 Server. + knife user edit for Open Source 11 Server is being deprecated. + Open Source 11 Server user commands now live under the knife oc_user namespace. + For backwards compatibility, we will forward this request to knife osc_user edit. + If you are using an Open Source 11 Server, please use that command to avoid this warning. + NOTE: Backwards compatibility for Open Source 11 Server in these commands will be removed + in Chef 15 which will be released April 2019. EOF end diff --git a/lib/chef/knife/user_reregister.rb b/lib/chef/knife/user_reregister.rb index b993dfc636..c79deb09a7 100644 --- a/lib/chef/knife/user_reregister.rb +++ b/lib/chef/knife/user_reregister.rb @@ -30,15 +30,15 @@ class Chef banner "knife user reregister USER (options)" def osc_11_warning - <<-EOF -The Chef Server you are using does not support the username field. -This means it is an Open Source 11 Server. -knife user reregister for Open Source 11 Server is being deprecated. -Open Source 11 Server user commands now live under the knife osc_user namespace. -For backwards compatibility, we will forward this request to knife osc_user reregister. -If you are using an Open Source 11 Server, please use that command to avoid this warning. -NOTE: Backwards compatibility for Open Source 11 Server in these commands will be removed -in Chef 15 which will be released April 2019. + <<~EOF + The Chef Server you are using does not support the username field. + This means it is an Open Source 11 Server. + knife user reregister for Open Source 11 Server is being deprecated. + Open Source 11 Server user commands now live under the knife osc_user namespace. + For backwards compatibility, we will forward this request to knife osc_user reregister. + If you are using an Open Source 11 Server, please use that command to avoid this warning. + NOTE: Backwards compatibility for Open Source 11 Server in these commands will be removed + in Chef 15 which will be released April 2019. EOF end diff --git a/lib/chef/knife/user_show.rb b/lib/chef/knife/user_show.rb index 6ba4ab5016..c2842aa576 100644 --- a/lib/chef/knife/user_show.rb +++ b/lib/chef/knife/user_show.rb @@ -32,15 +32,15 @@ class Chef banner "knife user show USER (options)" def osc_11_warning - <<-EOF -The Chef Server you are using does not support the username field. -This means it is an Open Source 11 Server. -knife user show for Open Source 11 Server is being deprecated. -Open Source 11 Server user commands now live under the knife osc_user namespace. -For backwards compatibility, we will forward this request to knife osc_user show. -If you are using an Open Source 11 Server, please use that command to avoid this warning. -NOTE: Backwards compatibility for Open Source 11 Server in these commands will be removed -in Chef 15 which will be released April 2019. + <<~EOF + The Chef Server you are using does not support the username field. + This means it is an Open Source 11 Server. + knife user show for Open Source 11 Server is being deprecated. + Open Source 11 Server user commands now live under the knife osc_user namespace. + For backwards compatibility, we will forward this request to knife osc_user show. + If you are using an Open Source 11 Server, please use that command to avoid this warning. + NOTE: Backwards compatibility for Open Source 11 Server in these commands will be removed + in Chef 15 which will be released April 2019. EOF end |