Move get_modules inside setcode
This commit is contained in:
parent
ecdcfe6b8b
commit
48281cb8de
@ -10,16 +10,13 @@ require "facter"
|
||||
require "set"
|
||||
|
||||
def get_modules
|
||||
if File.exists?("/proc/modules")
|
||||
return File.readlines("/proc/modules").inject(Set.new){|s,l|s << l[/\w+\b/] }
|
||||
end
|
||||
return File.readlines("/proc/modules").inject(Set.new){|s,l|s << l[/\w+\b/]}
|
||||
end
|
||||
|
||||
modules = get_modules
|
||||
|
||||
Facter.add("kernel_modules") do
|
||||
confine :kernel => :linux
|
||||
setcode do
|
||||
modules = get_modules
|
||||
modules.to_a.join(",")
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user