Moving fact to the same place as the custom function

This commit is contained in:
Gene Liverman 2017-10-15 17:25:36 -07:00
parent 247a779748
commit e546635780

View file

@ -1,19 +0,0 @@
Facter.add(:os_release) do
confine kernel: 'Linux'
setcode do
file_path = '/etc/os-release'
if File.exist?(file_path)
os_release_hash = {}
File.open(file_path, 'r') do |file|
file.each_line do |line|
line_data = line.split('=')
key = line_data[0].downcase
value = line_data[1].strip.gsub(/(^\")|(\"$)/, '')
os_release_hash[key] = value
end
end
os_release_hash
end
end
end