Sha256: a99574bb84e7ad4cf8419571d1f8a1bd9864cf605565980f4bc69503184de22e

Contents?: true

Size: 1.39 KB

Versions: 99

Compression:

Stored size: 1.39 KB

Contents

module Actions
  module Pulp
    module Orchestration
      module Repository
        class UploadContent < Pulp::Abstract
          include Actions::Helpers::OutputPropagator
          def plan(repository, smart_proxy, file, unit_type_id)
            sequence do
              upload_request = plan_action(Pulp::Repository::CreateUploadRequest)
              plan_action(Pulp::Repository::UploadFile,
                          upload_id: upload_request.output[:upload_id],
                          file: file[:path])
              plan_action(Pulp::Repository::ImportUpload,
                          repository, smart_proxy,
                          pulp_id: repository.pulp_id,
                          unit_type_id: unit_type_id,
                          unit_key: unit_key(file, repository),
                          upload_id: upload_request.output[:upload_id])
              plan_action(Pulp::Repository::DeleteUploadRequest,
                          upload_id: upload_request.output[:upload_id])
              plan_self(:subaction_output => nil)
            end
          end

          def unit_key(file, repository)
            return {} unless repository.file?
            {
              :checksum => Digest::SHA256.hexdigest(File.read(file[:path])),
              :name => file[:filename],
              :size => File.size(file[:path])
            }
          end
        end
      end
    end
  end
end

Version data entries

99 entries across 99 versions & 1 rubygems

Version Path
katello-3.18.0.rc1 app/lib/actions/pulp/orchestration/repository/upload_content.rb
katello-3.17.0.rc2.2 app/lib/actions/pulp/orchestration/repository/upload_content.rb
katello-3.17.0.rc2.1 app/lib/actions/pulp/orchestration/repository/upload_content.rb
katello-3.16.1.2 app/lib/actions/pulp/orchestration/repository/upload_content.rb
katello-3.16.1.1 app/lib/actions/pulp/orchestration/repository/upload_content.rb
katello-3.17.0.rc2 app/lib/actions/pulp/orchestration/repository/upload_content.rb
katello-3.16.1 app/lib/actions/pulp/orchestration/repository/upload_content.rb
katello-3.17.0.rc1 app/lib/actions/pulp/orchestration/repository/upload_content.rb
katello-3.16.0 app/lib/actions/pulp/orchestration/repository/upload_content.rb
katello-3.16.0.rc5.1 app/lib/actions/pulp/orchestration/repository/upload_content.rb
katello-3.16.0.rc5 app/lib/actions/pulp/orchestration/repository/upload_content.rb
katello-3.16.0.rc4.1 app/lib/actions/pulp/orchestration/repository/upload_content.rb
katello-3.16.0.rc4 app/lib/actions/pulp/orchestration/repository/upload_content.rb
katello-3.16.0.rc3.1 app/lib/actions/pulp/orchestration/repository/upload_content.rb
katello-3.16.0.rc3 app/lib/actions/pulp/orchestration/repository/upload_content.rb
katello-3.16.0.rc2.1 app/lib/actions/pulp/orchestration/repository/upload_content.rb
katello-3.16.0.rc2 app/lib/actions/pulp/orchestration/repository/upload_content.rb
katello-3.16.0.rc1.1 app/lib/actions/pulp/orchestration/repository/upload_content.rb
katello-3.16.0.rc1 app/lib/actions/pulp/orchestration/repository/upload_content.rb