Sha256: 4a6b3f29d5a070d63e419ad22e1d164410e48a5cded8ce788b0a38e7558ac669
Contents?: true
Size: 903 Bytes
Versions: 12
Compression:
Stored size: 903 Bytes
Contents
# frozen_string_literal: true require 'uri' module Uricp::Strategy class RbdCachedGet include Uricp::Strategy::Common include Uricp::Strategy::CacheCommon def appropriate? if from.scheme != 'rbd' || rbd_snapshot_spec?(from) debug "#{self.class.name}: not appropriate" return false end with_active_cache do cache_check = in_rbd_cache(rbd_image_spec(from)) return proposal(cache_check) if cache_check debug "#{self.class.name}: no rbd cache entry for #{options['from_uri']}" false end end def command ':;' end def proposal(cache_check) @proposed_options = options.dup @proposed_options['from_uri'] = rbd_uri(cache_check) @proposed_options.delete('cache') @proposed_options.delete('cache_name') @proposed_options.delete('dry-cache') self end end end
Version data entries
12 entries across 12 versions & 1 rubygems