Merge pull request #492 from chef/dr/fix-check

expose inspec errors during profile read
This commit is contained in:
Christoph Hartmann 2016-02-24 17:04:56 +01:00
commit 923fdcf35a
2 changed files with 8 additions and 2 deletions

View file

@ -49,6 +49,7 @@ module Inspec
end
def abs_path(file)
return nil if file.nil?
prefix + file
end

View file

@ -17,11 +17,16 @@ module Inspec
# Fetchers retrieve file contents
opts[:target] = target
fetcher = Inspec::Fetcher.resolve(target)
return nil if fetcher.nil?
if fetcher.nil?
fail("Could not fetch inspec profile in #{target.inspect}.")
end
# Source readers understand the target's structure and provide
# access to tests, libraries, and metadata
reader = Inspec::SourceReader.resolve(fetcher.relative_target)
return nil if reader.nil?
if reader.nil?
fail("Don't understand inspec profile in #{target.inspect}, it "\
"doesn't look like a supported profile structure.")
end
new(reader, opts)
end