Sha256: 8adc6658b80206140a5e1cb0a3b37992fb89c6e48b89a38e040ff3b6bd18aac4

Contents?: true

Size: 1.33 KB

Versions: 48

Compression:

Stored size: 1.33 KB

Contents

module Actions
  module Pulp
    module Repository
      class AbstractCopyContent < Pulp::AbstractAsyncTask
        input_format do
          param :source_pulp_id
          param :target_pulp_id
          param :clauses
          param :full_clauses
          param :override_config
          param :include_result
        end

        # @api override - pulp extension representing the content type to copy
        def content_extension
          fail NotImplementedError
        end

        def invoke_external_task
          optional = criteria
          optional[:override_config] = input[:override_config] if input[:override_config]
          content_extension.copy(input[:source_pulp_id],
                                 input[:target_pulp_id],
                                 criteria)
        end

        def criteria
          if input[:full_clauses]
            input[:full_clauses]
          elsif input[:clauses]
            { filters: {:unit => input[:clauses] } }
          else
            {}
          end
        end

        def external_task=(external_task_data)
          external_task_data = [external_task_data] if external_task_data.is_a?(Hash)
          external_task_data = external_task_data.map { |task| task.except('result') } unless input[:include_result]
          super(external_task_data)
        end
      end
    end
  end
end

Version data entries

48 entries across 48 versions & 1 rubygems

Version Path
katello-3.5.0.rc2 app/lib/actions/pulp/repository/abstract_copy_content.rb
katello-3.5.0.rc1 app/lib/actions/pulp/repository/abstract_copy_content.rb
katello-3.4.5 app/lib/actions/pulp/repository/abstract_copy_content.rb
katello-3.4.4 app/lib/actions/pulp/repository/abstract_copy_content.rb
katello-3.4.2 app/lib/actions/pulp/repository/abstract_copy_content.rb
katello-3.4.1 app/lib/actions/pulp/repository/abstract_copy_content.rb
katello-3.4.0.2 app/lib/actions/pulp/repository/abstract_copy_content.rb
katello-3.4.0.1 app/lib/actions/pulp/repository/abstract_copy_content.rb
katello-3.3.2 app/lib/actions/pulp/repository/abstract_copy_content.rb
katello-3.4.0 app/lib/actions/pulp/repository/abstract_copy_content.rb
katello-3.4.0.rc2 app/lib/actions/pulp/repository/abstract_copy_content.rb
katello-3.4.0.rc1 app/lib/actions/pulp/repository/abstract_copy_content.rb
katello-3.3.1.1 app/lib/actions/pulp/repository/abstract_copy_content.rb
katello-3.3.1 app/lib/actions/pulp/repository/abstract_copy_content.rb
katello-3.3.0.1 app/lib/actions/pulp/repository/abstract_copy_content.rb
katello-3.3.0 app/lib/actions/pulp/repository/abstract_copy_content.rb
katello-3.3.0.rc2 app/lib/actions/pulp/repository/abstract_copy_content.rb
katello-3.3.0.rc1.1 app/lib/actions/pulp/repository/abstract_copy_content.rb
katello-3.3.0.rc1 app/lib/actions/pulp/repository/abstract_copy_content.rb
katello-3.2.1.1 app/lib/actions/pulp/repository/abstract_copy_content.rb