mirror of
https://github.com/inspec/inspec
synced 2024-11-14 17:07:09 +00:00
throw fetcher and reader errors in profile detection
This commit is contained in:
parent
a46af20e66
commit
b75ba7d345
1 changed files with 7 additions and 2 deletions
|
@ -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…
Reference in a new issue