require 'fileutils' module Uricp::Strategy class PipedCache include Uricp::Strategy::Common include Uricp::Strategy::CacheCommon def appropriate? with_active_cache do case from.scheme when 'pipe' validate_cache! return proposal end debug "#{self.class.name}: not appropriate" false end end def command "tee #{temp_cache_file} |" end def proposal @proposed_options = options.dup @proposed_options['sweep'] = [temp_cache_file, cache_file] if to.scheme == 'rbd' @proposed_options['rbd_cache_name'] = rbd_cache_image_spec(to) end @proposed_options.delete('cache') @proposed_options.delete('cache_name') self end end end