diff --git a/puppet/production/site/custom_libs/lib/facter/os_release.rb b/puppet/production/site/custom_libs/lib/facter/os_release.rb index c3f50f2..1b3e883 100644 --- a/puppet/production/site/custom_libs/lib/facter/os_release.rb +++ b/puppet/production/site/custom_libs/lib/facter/os_release.rb @@ -7,10 +7,12 @@ Facter.add(:os_release) do 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 + unless line.nil? or line.strip.length.eql? 0 + line_data = line.split('=') + key = line_data[0].downcase + value = line_data[1].strip.gsub(/(^\")|(\"$)/, '') + os_release_hash[key] = value + end end end os_release_hash