From 0bbb70302d9800619989321fd43fd2ac36f28d45 Mon Sep 17 00:00:00 2001 From: Christoph Hartmann Date: Fri, 23 Oct 2015 13:57:37 +0200 Subject: [PATCH] bugfix: fix kernel_module in combination with CentOS 5 & sudo --- lib/resources/kernel_module.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/resources/kernel_module.rb b/lib/resources/kernel_module.rb index 0e9a3eba9..826829c35 100644 --- a/lib/resources/kernel_module.rb +++ b/lib/resources/kernel_module.rb @@ -19,8 +19,13 @@ class KernelModule < Vulcano.resource(1) end def loaded? + # default lsmod command + lsmod_cmd = 'lsmod' + # special care for CentOS 5 and sudo + lsmod_cmd = '/sbin/lsmod' if vulcano.os[:family] == 'centos' && vulcano.os[:release].to_i == 5 + # get list of all modules - cmd = vulcano.command('lsmod') + cmd = vulcano.command(lsmod_cmd) return false if cmd.exit_status != 0 # check if module is loaded