Method: Inspec::CachedFetcher#assert_cache_sanity!

Defined in:
lib/inspec/cached_fetcher.rb

#assert_cache_sanity!Object



50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/inspec/cached_fetcher.rb', line 50

def assert_cache_sanity!
  return unless target.respond_to?(:key?) && target.key?(:sha256)

  exception_message = "    The remote source \#{fetcher} no longer has the requested content:\n\n    Request Content Hash: \#{target[:sha256]}\n    Actual Content Hash: \#{fetcher.resolved_source[:sha256]}\n\n    For URL, supermarket, compliance, and other sources that do not\n    provide versioned artifacts, this likely means that the remote source\n    has changed since your lockfile was generated.\n  EOF\n  raise exception_message if fetcher.resolved_source[:sha256] != target[:sha256]\nend\n"