Sha256: 0a9dc9c53fcaaa3f27b369f37fa875e3eab64121614cbce25bcbf9f93a56faf4

Contents?: true

Size: 668 Bytes

Versions: 1

Compression:

Stored size: 668 Bytes

Contents

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

    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

1 entries across 1 versions & 1 rubygems

Version Path
uricp-0.0.24 lib/uricp/strategy/piped_rbd_get.rb