Class: Katello::Pulp3::Deb
Constant Summary
collapse
- CONTENT_TYPE =
"deb".freeze
Instance Attribute Summary
#backend_data, #uuid
Class Method Summary
collapse
included
add_timestamps, backend_unit_identifier, content_type, content_unit_list, #fetch_backend_data, fetch_content_list, find_duplicate_unit, #initialize, model_class, page_options, pulp_data, pulp_units_batch_all, pulp_units_batch_for_repo, pulp_units_for_ids, supports_id_fetch?, unit_identifier
Class Method Details
.content_api ⇒ Object
7
8
9
|
# File 'app/services/katello/pulp3/deb.rb', line 7
def self.content_api
PulpDebClient::ContentPackagesApi.new(Katello::Pulp3::Api::Apt.new(SmartProxy.pulp_primary!).api_client)
end
|
.content_api_create(opts = {}) ⇒ Object
11
12
13
14
|
# File 'app/services/katello/pulp3/deb.rb', line 11
def self.content_api_create(opts = {})
opts.delete(:relative_path) if opts.key?(:relative_path)
self.content_api.create(opts)
end
|
.create_content(options) ⇒ Object
16
17
18
19
|
# File 'app/services/katello/pulp3/deb.rb', line 16
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
|
.generate_model_row(unit) ⇒ Object
27
28
29
30
31
32
33
34
35
36
37
38
|
# File 'app/services/katello/pulp3/deb.rb', line 27
def self.generate_model_row(unit)
unit = unit.try(:with_indifferent_access)
return {
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
|
.ids_for_repository(repo_id) ⇒ Object
21
22
23
24
25
|
# File 'app/services/katello/pulp3/deb.rb', line 21
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
|