Sha256: bc1bdc3f439225f6e4d5e96cc0e2b24ee960bd88ae47144235ebea82e74955a1

Contents?: true

Size: 1.2 KB

Versions: 63

Compression:

Stored size: 1.2 KB

Contents

module Katello
  module Pulp3
    class GenericContentUnit < PulpContentUnit
      include LazyAccessor
      CONTENT_TYPE = "generic".freeze

      def self.fetch_content_list(page_opts, repository_type, content_type)
        content_unit_list page_opts, repository_type, content_type
      end

      def self.content_unit_list(page_opts, repository_type, content_type)
        self.content_api(repository_type, content_type).list page_opts
      end

      def self.content_api(repository_type, content_type)
        label = content_type.is_a?(String) ? content_type : content_type.label
        repository_type.content_types.find { |type| type.content_type == label }.pulp3_api.new(repository_type.pulp3_api_class.new(SmartProxy.pulp_primary!, repository_type).api_client)
      end

      def self.generate_model_row(unit, content_type)
        {
          pulp_id: unit['pulp_href'],
          name: content_type&.model_name&.call(unit),
          version: content_type&.model_version&.call(unit),
          filename: content_type&.model_filename&.call(unit),
          additional_metadata: content_type&.model_additional_metadata&.call(unit),
          content_type: content_type&.label
        }
      end
    end
  end
end

Version data entries

63 entries across 63 versions & 1 rubygems

Version Path
katello-4.14.3 app/services/katello/pulp3/generic_content_unit.rb
katello-4.14.2 app/services/katello/pulp3/generic_content_unit.rb
katello-4.14.1 app/services/katello/pulp3/generic_content_unit.rb
katello-4.14.0 app/services/katello/pulp3/generic_content_unit.rb
katello-4.14.0.rc3 app/services/katello/pulp3/generic_content_unit.rb
katello-4.14.0.rc2 app/services/katello/pulp3/generic_content_unit.rb
katello-4.14.0.rc1.1 app/services/katello/pulp3/generic_content_unit.rb
katello-4.14.0.rc1 app/services/katello/pulp3/generic_content_unit.rb
katello-4.13.1 app/services/katello/pulp3/generic_content_unit.rb
katello-4.13.0 app/services/katello/pulp3/generic_content_unit.rb
katello-4.12.1 app/services/katello/pulp3/generic_content_unit.rb
katello-4.13.0.rc1 app/services/katello/pulp3/generic_content_unit.rb
katello-4.12.0 app/services/katello/pulp3/generic_content_unit.rb
katello-4.12.0.rc3 app/services/katello/pulp3/generic_content_unit.rb
katello-4.12.0.rc2 app/services/katello/pulp3/generic_content_unit.rb
katello-4.12.0.rc1 app/services/katello/pulp3/generic_content_unit.rb
katello-4.11.1 app/services/katello/pulp3/generic_content_unit.rb
katello-4.11.0 app/services/katello/pulp3/generic_content_unit.rb
katello-4.11.0.rc2 app/services/katello/pulp3/generic_content_unit.rb
katello-4.11.0.rc1 app/services/katello/pulp3/generic_content_unit.rb