mirror of
https://github.com/inspec/inspec
synced 2024-11-23 13:13:22 +00:00
bugfix: fix kernel_module in combination with CentOS 5 & sudo
This commit is contained in:
parent
66a2be7f33
commit
0bbb70302d
1 changed files with 6 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue