summaryrefslogtreecommitdiff
path: root/lib/chef/api_client/registration.rb
diff options
context:
space:
mode:
authorTim Smith <tsmith84@gmail.com>2020-08-11 13:30:10 -0700
committerTim Smith <tsmith84@gmail.com>2020-08-12 14:02:34 -0700
commit4848c89b7cc5e4a4d4fac7c8bff962f7df69f719 (patch)
treecf1bc6d0b30f226573da88158049f1334b6ce1bd /lib/chef/api_client/registration.rb
parent798cac61accc035b51aaac25160bf1d5e9715252 (diff)
downloadchef-4848c89b7cc5e4a4d4fac7c8bff962f7df69f719.tar.gz
File.exists? -> File.exist?exist
Update some of these methods Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'lib/chef/api_client/registration.rb')
-rw-r--r--lib/chef/api_client/registration.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/chef/api_client/registration.rb b/lib/chef/api_client/registration.rb
index 02b7258fba..b05a2852a8 100644
--- a/lib/chef/api_client/registration.rb
+++ b/lib/chef/api_client/registration.rb
@@ -72,14 +72,14 @@ class Chef
def assert_destination_writable!
abs_path = File.expand_path(destination)
- unless File.exists?(File.dirname(abs_path))
+ unless File.exist?(File.dirname(abs_path))
begin
FileUtils.mkdir_p(File.dirname(abs_path))
rescue Errno::EACCES
raise Chef::Exceptions::CannotWritePrivateKey, "I can't create the configuration directory at #{File.dirname(abs_path)} - check permissions?"
end
end
- if (File.exists?(abs_path) && !File.writable?(abs_path)) || !File.writable?(File.dirname(abs_path))
+ if (File.exist?(abs_path) && !File.writable?(abs_path)) || !File.writable?(File.dirname(abs_path))
raise Chef::Exceptions::CannotWritePrivateKey, "I can't write your private key to #{abs_path} - check permissions?"
end
end