diff --git a/src/vmm_mad/exec/one_vmm_exec.rb b/src/vmm_mad/exec/one_vmm_exec.rb index 7ca4e0313e..c8ec0fd246 100755 --- a/src/vmm_mad/exec/one_vmm_exec.rb +++ b/src/vmm_mad/exec/one_vmm_exec.rb @@ -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 diff --git a/src/vmm_mad/remotes/lib/firecracker/microvm.rb b/src/vmm_mad/remotes/lib/firecracker/microvm.rb index e3acede0b7..6774292020 100644 --- a/src/vmm_mad/remotes/lib/firecracker/microvm.rb +++ b/src/vmm_mad/remotes/lib/firecracker/microvm.rb @@ -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