Sha256: f6558af9b4e504797e2e003dc3f1962a36dda7a056a50ae7c90eadc9c06b97fa

Contents?: true

Size: 1.28 KB

Versions: 12

Compression:

Stored size: 1.28 KB

Contents

module Katello
  module Pulp3
    class Deb < PulpContentUnit
      include LazyAccessor
      CONTENT_TYPE = "deb".freeze

      def self.content_api
        PulpDebClient::ContentPackagesApi.new(Katello::Pulp3::Api::Apt.new(SmartProxy.pulp_primary!).api_client)
      end

      def self.content_api_create(opts = {})
        self.content_api.create(opts)
      end

      def self.create_content(options)
        fail _("Artifact Id and relative path are needed to create content") unless options.dig(:file_name) && options.dig(:artifact)
        PulpDebClient::DebContent.new(relative_path: options[:file_name], artifact: options[:artifact])
      end

      def self.ids_for_repository(repo_id)
        repo = Katello::Pulp3::Repository::Apt.new(Katello::Repository.find(repo_id), SmartProxy.pulp_primary)
        repo_content_list = repo.content_list
        repo_content_list.map { |content| content.try(:pulp_href) }
      end

      def self.generate_model_row(unit)
        {
          pulp_id: unit[unit_identifier],
          checksum: unit[:sha256],
          filename: unit[:relative_path],
          name: unit[:package],
          version: unit[:version],
          description: unit[:description]&.truncate(255),
          architecture: unit[:architecture]
        }
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
katello-4.4.2.2 app/services/katello/pulp3/deb.rb
katello-4.4.2.1 app/services/katello/pulp3/deb.rb
katello-4.4.2 app/services/katello/pulp3/deb.rb
katello-4.5.0 app/services/katello/pulp3/deb.rb
katello-4.5.0.rc2 app/services/katello/pulp3/deb.rb
katello-4.4.1 app/services/katello/pulp3/deb.rb
katello-4.5.0.rc1 app/services/katello/pulp3/deb.rb
katello-4.4.0.2 app/services/katello/pulp3/deb.rb
katello-4.4.0.1 app/services/katello/pulp3/deb.rb
katello-4.4.0 app/services/katello/pulp3/deb.rb
katello-4.4.0.rc2 app/services/katello/pulp3/deb.rb
katello-4.4.0.rc1 app/services/katello/pulp3/deb.rb