From cf57e55407a6437fea6c540ae5578c6fc687d77f Mon Sep 17 00:00:00 2001 From: Quirin Pamp Date: Mon, 9 Dec 2024 16:49:52 +0100 Subject: [PATCH] Fixes #38096 - Fix flat APT repo handling --- app/models/katello/repository.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/models/katello/repository.rb b/app/models/katello/repository.rb index 3abccdeb136..f1daefb7681 100644 --- a/app/models/katello/repository.rb +++ b/app/models/katello/repository.rb @@ -1059,10 +1059,15 @@ def deb_pulp_components(version_href = self.version_href) pulp_api.list({:repository_version => version_href}).results.map { |x| x.component }.uniq end + def deb_sanitize_pulp_distribution(distribution) + return "flat-repo" if distribution&.end_with?("/") + distribution + end + def deb_pulp_distributions(version_href = self.version_href) return [] if version_href.blank? pulp_api = Katello::Pulp3::Repository.instance_for_type(self, SmartProxy.pulp_primary).api.content_release_components_api - pulp_api.list({:repository_version => version_href}).results.map { |x| x.distribution }.uniq + pulp_api.list({:repository_version => version_href}).results.map { |x| deb_sanitize_pulp_distribution(x.distribution) }.uniq end def sync_status