summaryrefslogtreecommitdiff
path: root/lib/mixlib/shellout/unix.rb
diff options
context:
space:
mode:
authorTim Smith <tsmith84@gmail.com>2020-09-09 15:26:16 -0700
committerTim Smith <tsmith84@gmail.com>2020-09-09 15:26:16 -0700
commite722fe8ca23533f83c3c6979c95bf2a160069c41 (patch)
tree68a05425d120612df21d0c26225895d0035bba31 /lib/mixlib/shellout/unix.rb
parente2a43f613ff1830175716acd541cf3bc921183d6 (diff)
downloadmixlib-shellout-safe.tar.gz
Simplify things a bit with &.safe
Use the latest and greatest ruby-isms to cut down on some code. Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'lib/mixlib/shellout/unix.rb')
-rw-r--r--lib/mixlib/shellout/unix.rb4
1 files changed, 2 insertions, 2 deletions
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