class Uricp::Strategy::RbdRemotePut

Public Instance Methods

appropriate?() click to toggle source
# File lib/uricp/strategy/rbd_remote_put.rb, line 5
def appropriate?
  if compression_required? || conversion_required?
    debug "#{self.class.name}: not ready to upload"
    return false
  end
  case from.scheme
  when 'pipe', 'file'
    return proposal if to.scheme == 'rbd'
  end
  debug "#{self.class.name}: not appropriate"
  false
end
command() click to toggle source
# File lib/uricp/strategy/rbd_remote_put.rb, line 18
def command
  "rbd import --no-progress --id #{rbd_id} #{data_source} '#{rbd_target(to)}';"
end
data_source() click to toggle source
# File lib/uricp/strategy/rbd_remote_put.rb, line 28
def data_source
  if from.scheme == 'pipe'
    '-'
  else
    "'#{from.path}'"
  end
end
proposal() click to toggle source
# File lib/uricp/strategy/rbd_remote_put.rb, line 22
def proposal
  @proposed_options = options.dup
  @proposed_options['from_uri'] = to
  self
end