L #-: Use File.empty?

(cherry picked from commit 88fa753e86)
This commit is contained in:
Tino Vázquez committed 2023-03-06 11:44:37 +01:00
1 parent ac2df5970c
commit 7aca9b1994
2 files changed
+3 -3

No files matched your search

+1 -1
View File
@@ -410,7 +410,7 @@ class ExecDriver < VirtualMachineDriver
# ----------------------------------------------------------------------
local_dfile = action.data[:local_dfile]
if !local_dfile || File.zero?(local_dfile)
if !local_dfile || File.empty?(local_dfile)
send_message(ACTION[:deploy], RESULT[:failure], id,
"Cannot open deployment file #{local_dfile}")
return
@@ -224,9 +224,9 @@ class MicroVM
t_start = Time.now
timeout = @one.fcrc[:cgroup_delete_timeout]
next while !File.read(path).empty? && (Time.now - t_start < timeout)
next while !File.empty?(path) && (Time.now - t_start < timeout)
File.read(path).empty?
File.empty?(path)
rescue Errno::ENOENT
end
# rubocop:enable Lint/SuppressedException