Skip to content

Commit

Permalink
fixup! [PR] Fixes #35959 - Add structured APT content mode
Browse files Browse the repository at this point in the history
  • Loading branch information
m-bucher committed Jan 26, 2024
1 parent a4ab1e1 commit 1cbaafc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 12 deletions.
2 changes: 1 addition & 1 deletion app/models/katello/root_repository.rb
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ def format_custom_content_path
path += "?#{params.join('&')}"
else
Rails.logger.warn("deb_use_structured_content is set, but repository #{self.name} is lacking deb_releases or deb_components, so we are defaulting to using simple content.")
if not Setting['deb_use_simple_publish']
unless Setting['deb_use_simple_publish']
Rails.logger.warn("Defaulting to using simple content for repository #{self.name}, but deb_use_simple_publish is not set! This can lead to errors on the clients!")
end
end
Expand Down
5 changes: 0 additions & 5 deletions app/services/katello/pulp3/repository/apt.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@ def sync_url_params(sync_options)
end

def mirror_remote_options
policy = smart_proxy.download_policy
if smart_proxy.download_policy == SmartProxy::DOWNLOAD_INHERIT
policy = repo.root.download_policy
end

if Setting['deb_use_structured_proxy_sync']
distributions = "#{repo.deb_releases}"
elsif Setting['deb_use_simple_publish']
Expand Down
12 changes: 6 additions & 6 deletions lib/katello/tasks/enable_structured_content_for_deb.rake
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
namespace :katello do
desc "Enable or disable the use of structured content for APT clients."
task :enable_structured_content_for_deb, ['deb_use_structured_content'] => ['environment', 'dynflow:client', "check_ping"] do |t, args|
task :enable_structured_content_for_deb, ['deb_use_structured_content'] => ['environment', 'dynflow:client', 'check_ping'] do |_t, args|
unless ['true', 'false'].include?(args[:deb_use_structured_content])
puts "You must specify if structured content should be enabled or disabled, your options are:"
puts " foreman-rake katello:enable_structured_content_for_deb[true]"
puts " foreman-rake katello:enable_structured_content_for_deb[false]"
puts 'You must specify if structured content should be enabled or disabled, your options are:'
puts ' foreman-rake katello:enable_structured_content_for_deb[true]'
puts ' foreman-rake katello:enable_structured_content_for_deb[false]'
puts "Note that use of structured content is currently set to '#{Setting['deb_use_structured_content']}'!"
puts "Note that after enabling structured content, you may need to resync your proxies!"
puts 'Note that after enabling structured content, you may need to resync your proxies!'
exit 1
end

Expand All @@ -25,7 +25,7 @@ namespace :katello do
roots.each do |root|
# Note that we are assuming root.deb_releases must necessarily be set already if url is also set.
components = root.deb_components
if components.blank? and deb_use_structured_content
if components.blank? && deb_use_structured_content
repo = root.library_instance
repo_backend_service = repo.backend_service(SmartProxy.pulp_primary)
pulp_components = repo_backend_service.api.content_release_components_api.list(repository_version: repo.version_href)
Expand Down

0 comments on commit 1cbaafc

Please sign in to comment.