diff options
author | Lamont Granquist <lamont@opscode.com> | 2021-06-23 09:01:31 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-23 09:01:31 -0700 |
commit | a4585799859f25bc3fcb3cc0019b216a488f8cb9 (patch) | |
tree | 63da18d3e4ad645f96e1b4e3b503a3173f140120 /lib | |
parent | 6cb1013e65df1d92e35134bf50fd78871ccd95e0 (diff) | |
parent | aeb27a1fa59225e4a42e72d02fdcc57e6a8f8cc6 (diff) | |
download | chef-a4585799859f25bc3fcb3cc0019b216a488f8cb9.tar.gz |
Merge pull request #11726 from chef/lcg/file-provider-file-exists
Diffstat (limited to 'lib')
-rw-r--r-- | lib/chef/provider/file.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/chef/provider/file.rb b/lib/chef/provider/file.rb index 59724a8340..96f6eef061 100644 --- a/lib/chef/provider/file.rb +++ b/lib/chef/provider/file.rb @@ -157,7 +157,7 @@ class Chef end action :delete do - if ::File.exists?(new_resource.path) + if ::File.exist?(new_resource.path) converge_by("delete file #{new_resource.path}") do do_backup unless file_class.symlink?(new_resource.path) ::File.delete(new_resource.path) @@ -393,7 +393,7 @@ class Chef # a nil tempfile is okay, means the resource has no content or no new content return if tempfile.nil? # but a tempfile that has no path or doesn't exist should not happen - if tempfile.path.nil? || !::File.exists?(tempfile.path) + if tempfile.path.nil? || !::File.exist?(tempfile.path) raise "#{ChefUtils::Dist::Infra::CLIENT} is confused, trying to deploy a file that has no path or does not exist..." end |