From e722fe8ca23533f83c3c6979c95bf2a160069c41 Mon Sep 17 00:00:00 2001 From: Tim Smith Date: Wed, 9 Sep 2020 15:26:16 -0700 Subject: Simplify things a bit with &. Use the latest and greatest ruby-isms to cut down on some code. Signed-off-by: Tim Smith --- lib/mixlib/shellout/unix.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/mixlib/shellout/unix.rb') diff --git a/lib/mixlib/shellout/unix.rb b/lib/mixlib/shellout/unix.rb index b8f42e0..5900302 100644 --- a/lib/mixlib/shellout/unix.rb +++ b/lib/mixlib/shellout/unix.rb @@ -370,11 +370,11 @@ module Mixlib return if attempt_reap @terminate_reason = "Command exceeded allowed execution time, process terminated" - logger.error("Command exceeded allowed execution time, sending TERM") if logger + logger&.error("Command exceeded allowed execution time, sending TERM") Process.kill(:TERM, child_pgid) sleep 3 attempt_reap - logger.error("Command exceeded allowed execution time, sending KILL") if logger + logger&.error("Command exceeded allowed execution time, sending KILL") Process.kill(:KILL, child_pgid) reap -- cgit v1.2.1