diff --git a/itchef/cookbooks/cpe_flatpak/libraries/flatpak_helpers.rb b/itchef/cookbooks/cpe_flatpak/libraries/flatpak_helpers.rb index 5bd36c77..ddd886f7 100644 --- a/itchef/cookbooks/cpe_flatpak/libraries/flatpak_helpers.rb +++ b/itchef/cookbooks/cpe_flatpak/libraries/flatpak_helpers.rb @@ -28,7 +28,7 @@ def flatpak_remotes_receipt_path end def flatpak_remotes_receipt - return [] unless ::File.exists?(flatpak_remotes_receipt_path) + return [] unless ::File.exist?(flatpak_remotes_receipt_path) Chef::JSONCompat.from_json(::File.read(flatpak_remotes_receipt_path)) rescue StandardError [] @@ -39,7 +39,7 @@ def flatpak_packages_receipt_path end def flatpak_packages_receipt - return [] unless ::File.exists?(flatpak_packages_receipt_path) + return [] unless ::File.exist?(flatpak_packages_receipt_path) Chef::JSONCompat.from_json(::File.read(flatpak_packages_receipt_path)) rescue StandardError [] diff --git a/itchef/cookbooks/cpe_remote/resources/file.rb b/itchef/cookbooks/cpe_remote/resources/file.rb index e0133255..7db690e5 100644 --- a/itchef/cookbooks/cpe_remote/resources/file.rb +++ b/itchef/cookbooks/cpe_remote/resources/file.rb @@ -46,7 +46,7 @@ load_current_value do |desired| # ~FC006 path = desired.path - if ::File.exists?(path) + if ::File.exist?(path) f_stat = ::File.stat(path) checksum_ondisk = Chef::Digester.checksum_for_file(path) checksum checksum_ondisk diff --git a/itchef/cookbooks/cpe_remote/resources/zip.rb b/itchef/cookbooks/cpe_remote/resources/zip.rb index d32016d8..4ace43a2 100644 --- a/itchef/cookbooks/cpe_remote/resources/zip.rb +++ b/itchef/cookbooks/cpe_remote/resources/zip.rb @@ -44,13 +44,13 @@ extra_loco = extract_location.delete(':') zip_path = ::File.join(chef_cache, 'remote_zip', extra_loco, zip_name) - if ::File.exists?(zip_path) + if ::File.exist?(zip_path) checksum_ondisk = Chef::Digester.checksum_for_file(zip_path) zip_checksum checksum_ondisk end extract_path = desired.extract_location - if ::File.exists?(extract_path) + if ::File.exist?(extract_path) f_stat = ::File.stat(extract_path) unless platform?('windows') owner ::Etc.getpwuid(f_stat.uid).name diff --git a/itchef/cookbooks/cpe_symlinks/resources/cpe_symlinks.rb b/itchef/cookbooks/cpe_symlinks/resources/cpe_symlinks.rb index 47f5c2eb..0a04f842 100644 --- a/itchef/cookbooks/cpe_symlinks/resources/cpe_symlinks.rb +++ b/itchef/cookbooks/cpe_symlinks/resources/cpe_symlinks.rb @@ -30,7 +30,7 @@ # Create symlinks on disk node['cpe_symlinks'].to_h.map.each do |target_dir, symlinks| symlinks.each do |target, source| - next unless ::File.exists?(source) + next unless ::File.exist?(source) link ::File.join(target_dir, target) do to source end