Sha256: 199b3dd7d1ba5e859de29c0847e732b1a8eb74680331965e94241da9297fedef

Contents?: true

Size: 694 Bytes

Versions: 4

Compression:

Stored size: 694 Bytes

Contents

require 'json'
module Uricp::Strategy
  class PipedRbdGet
    include Uricp::Strategy::Common
    include Uricp::Strategy::CacheCommon
    include Methadone::SH

    def appropriate?
      without_active_cache do
        if from.scheme == 'rbd' &&
          rbd_snapshot_spec?(from) &&
          to.scheme != 'rbd'
          return proposal unless sequence_complete?
        end
      end
      debug "#{self.class.name}: not appropriate"
      false
    end

    def command
      "rbd export --no-progress --id #{rbd_id} '#{rbd_image_spec(from)}' - |"
    end

    def proposal
      @proposed_options = options.dup
      @proposed_options['from_uri'] = PIPE_URI
      self
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
uricp-0.0.23 lib/uricp/strategy/piped_rbd_get.rb
uricp-0.0.22 lib/uricp/strategy/piped_rbd_get.rb
uricp-0.0.21 lib/uricp/strategy/piped_rbd_get.rb
uricp-0.0.20 lib/uricp/strategy/piped_rbd_get.rb