Skip to content

Commit

Permalink
Fixes #35959 - prepare to use structured publisher for deb content
Browse files Browse the repository at this point in the history
  • Loading branch information
sbernhard committed Jan 17, 2023
1 parent f432a51 commit bbf8ecf
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/lib/actions/katello/product/content_create.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def plan(root)
arches: root.format_arches,
label: root.custom_content_label,
os_versions: root.os_versions&.join(','),
content_url: root.custom_content_path)
content_url: root.format_custom_content_path)
content_id = content_create.output[:response][:id]
plan_action(Candlepin::Product::ContentAdd, owner: root.product.organization.label,
product_id: root.product.cp_id,
Expand All @@ -32,7 +32,7 @@ def plan(root)
type: root.content_type,
arches: root.format_arches,
label: root.custom_content_label,
content_url: root.custom_content_path,
content_url: root.format_custom_content_path,
gpg_key_url: root.library_instance.yum_gpg_key_url)
end

Expand Down
2 changes: 1 addition & 1 deletion app/lib/actions/katello/repository/update.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def plan(root, repo_params)
:owner => repository.organization.label,
:content_id => root.content_id,
:name => root.name,
:content_url => root.custom_content_path,
:content_url => root.format_custom_content_path,
:gpg_key_url => repository.yum_gpg_key_url,
:label => content.label,
:type => root.content_type,
Expand Down
8 changes: 8 additions & 0 deletions app/models/katello/root_repository.rb
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,14 @@ def format_arches
end
end

def format_custom_content_path
if content_type == ::Katello::Repository::DEB_TYPE
"#{custom_content_path}/?comp=#{deb_components.gsub(" ", ",")}&rel=#{deb_releases.gsub(" ", ",")}"
else
custom_content_path
end
end

apipie :class, desc: 'A class representing Repository object' do
name 'Repository'
refs 'Repository'
Expand Down

0 comments on commit bbf8ecf

Please sign in to comment.