Sha256: 8ba1c90fba0bb630f4ef69e4171dea87fed9272eff08d27a8bac0484d6e083e5

Contents?: true

Size: 719 Bytes

Versions: 12

Compression:

Stored size: 719 Bytes

Contents

# frozen_string_literal: true

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

12 entries across 12 versions & 1 rubygems

Version Path
uricp-0.0.37 lib/uricp/strategy/rbd_cache_base_snap.rb
uricp-0.0.36 lib/uricp/strategy/rbd_cache_base_snap.rb
uricp-0.0.35 lib/uricp/strategy/rbd_cache_base_snap.rb
uricp-0.0.34 lib/uricp/strategy/rbd_cache_base_snap.rb
uricp-0.0.32 lib/uricp/strategy/rbd_cache_base_snap.rb
uricp-0.0.31 lib/uricp/strategy/rbd_cache_base_snap.rb
uricp-0.0.30 lib/uricp/strategy/rbd_cache_base_snap.rb
uricp-0.0.29 lib/uricp/strategy/rbd_cache_base_snap.rb
uricp-0.0.28 lib/uricp/strategy/rbd_cache_base_snap.rb
uricp-0.0.27 lib/uricp/strategy/rbd_cache_base_snap.rb
uricp-0.0.26 lib/uricp/strategy/rbd_cache_base_snap.rb
uricp-0.0.25 lib/uricp/strategy/rbd_cache_base_snap.rb