From bbf8ecfd932283851d37749ed488f56b0d4b1ef7 Mon Sep 17 00:00:00 2001 From: Bernhard Suttner Date: Tue, 17 Jan 2023 09:54:17 +0100 Subject: [PATCH] Fixes #35959 - prepare to use structured publisher for deb content --- app/lib/actions/katello/product/content_create.rb | 4 ++-- app/lib/actions/katello/repository/update.rb | 2 +- app/models/katello/root_repository.rb | 8 ++++++++ 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/app/lib/actions/katello/product/content_create.rb b/app/lib/actions/katello/product/content_create.rb index eef027f6f55..758b023b4b1 100644 --- a/app/lib/actions/katello/product/content_create.rb +++ b/app/lib/actions/katello/product/content_create.rb @@ -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, @@ -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 diff --git a/app/lib/actions/katello/repository/update.rb b/app/lib/actions/katello/repository/update.rb index dd81ddb0c95..b322bb1f129 100644 --- a/app/lib/actions/katello/repository/update.rb +++ b/app/lib/actions/katello/repository/update.rb @@ -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, diff --git a/app/models/katello/root_repository.rb b/app/models/katello/root_repository.rb index df26cbaeec9..d288b725343 100644 --- a/app/models/katello/root_repository.rb +++ b/app/models/katello/root_repository.rb @@ -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'