Sha256: 40b00b12af16727cfcf9aef26d895dbfd55cf33af52bf35f6c2fb1a732359ea4

Contents?: true

Size: 1.38 KB

Versions: 48

Compression:

Stored size: 1.38 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 update_model(model)
        custom_json = {}
        custom_json['checksum'] = backend_data['sha256']
        custom_json['filename'] = backend_data['relative_path']
        custom_json['name'] = backend_data['package']
        custom_json['version'] = backend_data['version']
        custom_json['description'] = backend_data['description']
        custom_json['architecture'] = backend_data['architecture']
        model.update!(custom_json)
      end
    end
  end
end

Version data entries

48 entries across 48 versions & 1 rubygems

Version Path
katello-4.3.1 app/services/katello/pulp3/deb.rb
katello-4.2.2 app/services/katello/pulp3/deb.rb
katello-4.3.0 app/services/katello/pulp3/deb.rb
katello-4.3.0.rc4 app/services/katello/pulp3/deb.rb
katello-4.3.0.rc3 app/services/katello/pulp3/deb.rb
katello-4.3.0.rc2.1 app/services/katello/pulp3/deb.rb
katello-4.3.0.rc2 app/services/katello/pulp3/deb.rb
katello-4.3.0.rc1 app/services/katello/pulp3/deb.rb
katello-4.2.1 app/services/katello/pulp3/deb.rb
katello-4.2.0.1 app/services/katello/pulp3/deb.rb
katello-4.1.4 app/services/katello/pulp3/deb.rb
katello-4.0.3 app/services/katello/pulp3/deb.rb
katello-4.2.0.1.rc3 app/services/katello/pulp3/deb.rb
katello-3.18.5 app/services/katello/pulp3/deb.rb
katello-4.2.0.1.rc2 app/services/katello/pulp3/deb.rb
katello-4.2.0.rc2 app/services/katello/pulp3/deb.rb
katello-4.1.3 app/services/katello/pulp3/deb.rb
katello-4.2.0.rc1 app/services/katello/pulp3/deb.rb
katello-4.0.2.1 app/services/katello/pulp3/deb.rb
katello-4.1.2.1 app/services/katello/pulp3/deb.rb