mirror of
https://github.com/inspec/inspec
synced 2024-11-23 13:13:22 +00:00
Implementation for local fetcher
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
This commit is contained in:
parent
82ae3b5fa1
commit
f4a3cf9144
2 changed files with 14 additions and 1 deletions
|
@ -62,7 +62,7 @@ module Inspec
|
|||
begin
|
||||
dep.resolved_source
|
||||
rescue Inspec::FetcherFailure
|
||||
Inspec::Log.debug("Failed to fetch #{dep.name}, a falling back to archives if possible")
|
||||
Inspec::Log.debug("Failed to fetch #{dep.name}, falling back to archives if possible")
|
||||
retry if fallback_to_archive_on_fetch_failure(dep)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -100,6 +100,19 @@ module Inspec::Fetcher
|
|||
end
|
||||
end
|
||||
|
||||
def update_from_opts(opts)
|
||||
changed = false
|
||||
|
||||
old_val = @archive_shasum
|
||||
new_val = opts[:sha256]
|
||||
unless old_val == new_val
|
||||
@archive_shasum = new_val
|
||||
changed = true
|
||||
end
|
||||
|
||||
changed
|
||||
end
|
||||
|
||||
def perform_shasum(target)
|
||||
return @archive_shasum if @archive_shasum
|
||||
raise(Inspec::FetcherFailure, "Profile dependency local path '#{target}' does not exist") unless File.exist?(target)
|
||||
|
|
Loading…
Reference in a new issue