Sha256: 5ec48c613732023de54e760d259dd689b8a601a71ad3f0a9405ad711669c3e28

Contents?: true

Size: 716 Bytes

Versions: 2

Compression:

Stored size: 716 Bytes

Contents

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

    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

2 entries across 2 versions & 1 rubygems

Version Path
uricp-0.0.21 lib/uricp/strategy/rbd_cache_base_snap.rb
uricp-0.0.20 lib/uricp/strategy/rbd_cache_base_snap.rb