summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2018-07-05 19:03:11 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2018-07-05 19:03:11 -0700
commit0efe5c2dc66077671b4e2f995bfb074955fd3a0e (patch)
tree3e2ce7dbea35ff0ddfd9de3a31a2f0bfd2f66316
parentd3d4198c971830715bbf4f5feee7e9f61503f9df (diff)
downloadchef-0efe5c2dc66077671b4e2f995bfb074955fd3a0e.tar.gz
fix some chefstyle offenses
might be an old PR got merged Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
-rw-r--r--chef-config/lib/chef-config/config.rb8
-rw-r--r--chef-config/lib/chef-config/workstation_config_loader.rb4
2 files changed, 6 insertions, 6 deletions
diff --git a/chef-config/lib/chef-config/config.rb b/chef-config/lib/chef-config/config.rb
index 3bba8af7f4..0046d25f78 100644
--- a/chef-config/lib/chef-config/config.rb
+++ b/chef-config/lib/chef-config/config.rb
@@ -970,10 +970,10 @@ module ChefConfig
# TODO add some post-file-parsing logic that automatically calls this so
# users don't have to
def self.export_proxies
- export_proxy("http", http_proxy, http_proxy_user, http_proxy_pass) if has_key?(:http_proxy) && http_proxy
- export_proxy("https", https_proxy, https_proxy_user, https_proxy_pass) if has_key?(:https_proxy) && https_proxy
- export_proxy("ftp", ftp_proxy, ftp_proxy_user, ftp_proxy_pass) if has_key?(:ftp_proxy) && ftp_proxy
- export_no_proxy(no_proxy) if has_key?(:no_proxy) && no_proxy
+ export_proxy("http", http_proxy, http_proxy_user, http_proxy_pass) if key?(:http_proxy) && http_proxy
+ export_proxy("https", https_proxy, https_proxy_user, https_proxy_pass) if key?(:https_proxy) && https_proxy
+ export_proxy("ftp", ftp_proxy, ftp_proxy_user, ftp_proxy_pass) if key?(:ftp_proxy) && ftp_proxy
+ export_no_proxy(no_proxy) if key?(:no_proxy) && no_proxy
end
# Character classes for Addressable
diff --git a/chef-config/lib/chef-config/workstation_config_loader.rb b/chef-config/lib/chef-config/workstation_config_loader.rb
index 2afe8de547..65940102fc 100644
--- a/chef-config/lib/chef-config/workstation_config_loader.rb
+++ b/chef-config/lib/chef-config/workstation_config_loader.rb
@@ -224,12 +224,12 @@ module ChefConfig
# If we don't have a better guess use the username.
Config[:node_name] ||= Etc.getlogin
# If we don't have a key (path or inline) check user.pem and $node_name.pem.
- unless Config.has_key?(:client_key) || Config.has_key?(:client_key_contents)
+ unless Config.key?(:client_key) || Config.key?(:client_key_contents)
Config[:client_key] = find_default_key(["#{Config[:node_name]}.pem", "user.pem"])
end
# Similarly look for a validation key file, though this should be less
# common these days.
- unless Config.has_key?(:validation_key) || Config.has_key?(:validation_key_contents)
+ unless Config.key?(:validation_key) || Config.key?(:validation_key_contents)
Config[:validation_key] = find_default_key(["#{Config[:validation_client_name]}.pem", "validator.pem", "validation.pem"])
end
end