mirror of
https://github.com/inspec/inspec
synced 2025-02-17 14:38:43 +00:00
Merge pull request #492 from chef/dr/fix-check
expose inspec errors during profile read
This commit is contained in:
commit
923fdcf35a
2 changed files with 8 additions and 2 deletions
|
@ -49,6 +49,7 @@ module Inspec
|
|||
end
|
||||
|
||||
def abs_path(file)
|
||||
return nil if file.nil?
|
||||
prefix + file
|
||||
end
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue