Sha256: 848317fdbe6aacb8ccd85580b7bfa3b6e6c980ef53b2ea6888eba8046db5c3d9

Contents?: true

Size: 687 Bytes

Versions: 1

Compression:

Stored size: 687 Bytes

Contents

module Uricp::Strategy
  class RbdCacheBaseSnap
    include Uricp::Strategy::Common

    def appropriate?
      if rbd_cache_name &&
        rbd_image_spec(from) == rbd_cache_name
        return proposal
      end
      debug "#{self.class.name}: not appropriate"
      false
    end

    def command
      "rbd snap create --id #{rbd_id} '#{rbd_clone_snapshot(rbd_cache_name)}';"\
      "rbd snap protect --id #{rbd_id} '#{rbd_clone_snapshot(rbd_cache_name)}';"
    end

    def proposal
      @proposed_options = options.dup
      @proposed_options['from_uri'] = rbd_uri(rbd_clone_snapshot(rbd_cache_name))
      @proposed_options.delete('rbd_cache_name')
      self
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

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