summaryrefslogtreecommitdiff
path: root/lib/chef/knife
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2019-01-15 13:07:58 -0800
committerLamont Granquist <lamont@scriptkiddie.org>2019-01-15 13:07:58 -0800
commit990974ca5cd44df0c77bb6a12fc57a3c32b92e23 (patch)
tree5779719f58254764e57eb9cacde85837295fd2f6 /lib/chef/knife
parent4be1ebe66460efb0535e500d6ecb52a147346519 (diff)
downloadchef-990974ca5cd44df0c77bb6a12fc57a3c32b92e23.tar.gz
changes for rubocop engine upgrades.lcg/rubocop-upgrades
this is the result of changes to rules we already previously had enabled. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'lib/chef/knife')
-rw-r--r--lib/chef/knife/configure.rb2
-rw-r--r--lib/chef/knife/cookbook_upload.rb2
-rw-r--r--lib/chef/knife/core/cookbook_scm_repo.rb2
-rw-r--r--lib/chef/knife/core/gem_glob_loader.rb4
-rw-r--r--lib/chef/knife/core/node_presenter.rb16
-rw-r--r--lib/chef/knife/key_create.rb2
-rw-r--r--lib/chef/knife/key_edit.rb2
-rw-r--r--lib/chef/knife/key_list.rb2
-rw-r--r--lib/chef/knife/ssl_check.rb6
-rw-r--r--lib/chef/knife/ssl_fetch.rb2
10 files changed, 20 insertions, 20 deletions
diff --git a/lib/chef/knife/configure.rb b/lib/chef/knife/configure.rb
index 18cec044a6..e24958e1fc 100644
--- a/lib/chef/knife/configure.rb
+++ b/lib/chef/knife/configure.rb
@@ -80,7 +80,7 @@ class Chef
client_name = '#{new_client_name}'
client_key = '#{new_client_key}'
chef_server_url = '#{chef_server}'
-EOH
+ EOH
end
if config[:initial]
diff --git a/lib/chef/knife/cookbook_upload.rb b/lib/chef/knife/cookbook_upload.rb
index 02bea271b2..57a63c7b47 100644
--- a/lib/chef/knife/cookbook_upload.rb
+++ b/lib/chef/knife/cookbook_upload.rb
@@ -26,7 +26,7 @@ class Chef
class CookbookUpload < Knife
CHECKSUM = "checksum".freeze
- MATCH_CHECKSUM = /[0-9a-f]{32,}/
+ MATCH_CHECKSUM = /[0-9a-f]{32,}/.freeze
deps do
require "chef/exceptions"
diff --git a/lib/chef/knife/core/cookbook_scm_repo.rb b/lib/chef/knife/core/cookbook_scm_repo.rb
index f583f0bd8e..ba3a40207a 100644
--- a/lib/chef/knife/core/cookbook_scm_repo.rb
+++ b/lib/chef/knife/core/cookbook_scm_repo.rb
@@ -22,7 +22,7 @@ class Chef
class Knife
class CookbookSCMRepo
- DIRTY_REPO = /^[\s]+M/
+ DIRTY_REPO = /^[\s]+M/.freeze
include Chef::Mixin::ShellOut
diff --git a/lib/chef/knife/core/gem_glob_loader.rb b/lib/chef/knife/core/gem_glob_loader.rb
index c4523d69ad..987aef754f 100644
--- a/lib/chef/knife/core/gem_glob_loader.rb
+++ b/lib/chef/knife/core/gem_glob_loader.rb
@@ -22,8 +22,8 @@ class Chef
class Knife
class SubcommandLoader
class GemGlobLoader < Chef::Knife::SubcommandLoader
- MATCHES_CHEF_GEM = %r{/chef-[\d]+\.[\d]+\.[\d]+}
- MATCHES_THIS_CHEF_GEM = %r{/chef-#{Chef::VERSION}(-\w+)?(-\w+)?/}
+ MATCHES_CHEF_GEM = %r{/chef-[\d]+\.[\d]+\.[\d]+}.freeze
+ MATCHES_THIS_CHEF_GEM = %r{/chef-#{Chef::VERSION}(-\w+)?(-\w+)?/}.freeze
def subcommand_files
@subcommand_files ||= (gem_and_builtin_subcommands.values + site_subcommands).flatten.uniq
diff --git a/lib/chef/knife/core/node_presenter.rb b/lib/chef/knife/core/node_presenter.rb
index 7cb0e4d6fe..5072cc4ae2 100644
--- a/lib/chef/knife/core/node_presenter.rb
+++ b/lib/chef/knife/core/node_presenter.rb
@@ -100,38 +100,38 @@ class Chef
summarized = <<~SUMMARY
#{ui.color('Node Name:', :bold)} #{ui.color(node.name, :bold)}
-SUMMARY
+ 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}
-POLICY
+ POLICY
else
summarized << <<~ENV
#{key('Environment:')} #{node.chef_environment}
-ENV
+ ENV
end
summarized << <<~SUMMARY
#{key('FQDN:')} #{node[:fqdn]}
#{key('IP:')} #{ip}
#{key('Run List:')} #{node.run_list}
-SUMMARY
+ SUMMARY
unless show_policy
summarized << <<~ROLES
#{key('Roles:')} #{Array(node[:roles]).join(', ')}
-ROLES
+ ROLES
end
summarized << <<~SUMMARY
#{key('Recipes:')} #{Array(node[:recipes]).join(', ')}
#{key('Platform:')} #{node[:platform]} #{node[:platform_version]}
#{key('Tags:')} #{node.tags.join(', ')}
-SUMMARY
+ SUMMARY
if config[:medium_output] || config[:long_output]
summarized += <<~MORE
#{key('Attributes:')}
#{text_format(node.normal_attrs)}
-MORE
+ MORE
end
if config[:long_output]
summarized += <<~MOST
@@ -141,7 +141,7 @@ MORE
#{text_format(node.override_attrs)}
#{key('Automatic Attributes (Ohai Data):')}
#{text_format(node.automatic_attrs)}
-MOST
+ MOST
end
summarized
else
diff --git a/lib/chef/knife/key_create.rb b/lib/chef/knife/key_create.rb
index 395bbc4bfd..f278af8b77 100644
--- a/lib/chef/knife/key_create.rb
+++ b/lib/chef/knife/key_create.rb
@@ -44,7 +44,7 @@ class Chef
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
+ EOS
end
def edit_data(key)
diff --git a/lib/chef/knife/key_edit.rb b/lib/chef/knife/key_edit.rb
index d05ee11d1c..4e36bdfded 100644
--- a/lib/chef/knife/key_edit.rb
+++ b/lib/chef/knife/key_edit.rb
@@ -46,7 +46,7 @@ class Chef
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
+ EOS
end
def edit_data(key)
diff --git a/lib/chef/knife/key_list.rb b/lib/chef/knife/key_list.rb
index 9d3a2c0c26..3078ca44d3 100644
--- a/lib/chef/knife/key_list.rb
+++ b/lib/chef/knife/key_list.rb
@@ -43,7 +43,7 @@ class Chef
<<~EOS
You cannot pass both --only-expired and --only-non-expired.
Please pass one or none.
-EOS
+ EOS
end
def display_info(string)
diff --git a/lib/chef/knife/ssl_check.rb b/lib/chef/knife/ssl_check.rb
index 858ab3cf89..6508c5f02d 100644
--- a/lib/chef/knife/ssl_check.rb
+++ b/lib/chef/knife/ssl_check.rb
@@ -171,7 +171,7 @@ class Chef
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
+ BAD_CERTS
# @TODO: ^ needs URL once documentation is posted.
end
@@ -200,7 +200,7 @@ BAD_CERTS
using SSH/SCP or some other secure method, then re-run this command to confirm
that the server's certificate is now trusted.
-ADVICE
+ ADVICE
end
def debug_invalid_host
@@ -222,7 +222,7 @@ ADVICE
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
+ ADVICE
end
def debug_ssl_settings
diff --git a/lib/chef/knife/ssl_fetch.rb b/lib/chef/knife/ssl_fetch.rb
index 88eb95e97d..9e1579a5f8 100644
--- a/lib/chef/knife/ssl_fetch.rb
+++ b/lib/chef/knife/ssl_fetch.rb
@@ -137,7 +137,7 @@ class Chef
Knife has no means to verify these are the correct certificates. You should
verify the authenticity of these certificates after downloading.
-TRUST_TRUST
+ TRUST_TRUST
remote_cert_chain.each do |cert|
write_cert(cert)
end