Merge pull request #570 from chef/dr/fix-parse_config-crash

bugfix: dont crash on read_file contents in parse_config
This commit is contained in:
Dominik Richter 2016-03-22 19:23:01 +01:00
commit bf44bed7a7

View file

@ -47,7 +47,7 @@ module Inspec::Resources
if !inspec.file(conf_path).file?
return skip_resource "Can't find file \"#{conf_path}\""
end
@content = read_file(conf_path)
@content = read_file(conf_path).to_s
if @content.empty? && inspec.file(conf_path).size > 0
return skip_resource "Can't read file \"#{conf_path}\""
end