summaryrefslogtreecommitdiff
path: root/lib/chef/knife
diff options
context:
space:
mode:
authorMarc A. Paradise <marc.paradise@gmail.com>2019-04-18 15:35:22 -0400
committerMarc A. Paradise <marc.paradise@gmail.com>2019-04-24 13:29:00 -0400
commitcd1a90b44f74f86f9479de657feff6748f2a7a07 (patch)
tree0f138b97ac1618aa7ac1ef75a89bdf8834cf410d /lib/chef/knife
parent05f75ab5a29ad2b563d13d90281508db4916c9c2 (diff)
downloadchef-cd1a90b44f74f86f9479de657feff6748f2a7a07.tar.gz
Rubocop
Signed-off-by: Marc A. Paradise <marc.paradise@gmail.com>
Diffstat (limited to 'lib/chef/knife')
-rw-r--r--lib/chef/knife/bootstrap.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/chef/knife/bootstrap.rb b/lib/chef/knife/bootstrap.rb
index 5a2c00b91c..b68fb1aa1e 100644
--- a/lib/chef/knife/bootstrap.rb
+++ b/lib/chef/knife/bootstrap.rb
@@ -371,8 +371,8 @@ class Chef
],
winrm_authentication_protocol: [:winrm_auth_method,
"--winrm-authentication-protocol PROTOCOL",
- ]
- }
+ ],
+ }.freeze
DEPRECATED_FLAGS.each do |flag, new_flag_config|
new_flag, old_long = new_flag_config
@@ -513,13 +513,13 @@ class Chef
# This can be moved up to the base knife class if it's agreeable.
def warn_and_map_deprecated_flags
DEPRECATED_FLAGS.each do |old_key, new_flag_config|
- new_key, _ = new_flag_config
- if (config.key?(old_key) && config_source(old_key) == :cli)
+ new_key, = new_flag_config
+ if config.key?(old_key) && config_source(old_key) == :cli
# TODO - do we want the same warnings for knife config keys
# in absence of CLI keys?
if config.key?(new_key) && config_source(new_key) == :cli
- new_key_name = "--#{new_key.to_s.gsub("_", "-")}"
- old_key_name = "--#{old_key.to_s.gsub("_", "-")}"
+ new_key_name = "--#{new_key.to_s.tr("_", "-")}"
+ old_key_name = "--#{old_key.to_s.tr("_", "-")}"
ui.warn <<~EOM
You provided both #{new_key_name} and #{old_key_name}.
Using: '#{new_key_name.split(" ").first} #{config[new_key]}' because #{old_key_name} is deprecated.