bugfix: fix kernel_module in combination with CentOS 5 & sudo

This commit is contained in:
Christoph Hartmann 2015-10-23 13:57:37 +02:00
parent 66a2be7f33
commit 0bbb70302d

View file

@ -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