Skip to content

Commit

Permalink
fixup! fixup! Fixes #35959 - Add structured APT content mode
Browse files Browse the repository at this point in the history
  • Loading branch information
quba42 committed Sep 24, 2024
1 parent e18e2aa commit 7e8cb01
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion app/lib/actions/candlepin/product/content_create.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def run
# We must retrieve the repository in the run phase, so the latest Pulp version_href is
# already set. This is needed to retrieve the latest repository.deb_content_url_options!
repository = ::Katello::Repository.find(input[:repository_id])
if repository.root.deb_using_structured_apt?
if repository.deb_using_structured_apt?
content_url += repository.deb_content_url_options
end
end
Expand Down
2 changes: 1 addition & 1 deletion app/lib/actions/candlepin/product/content_update.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def finalize
# We must retrieve the repository in the finalize phase, because Katello::Product::ContentCreate
# only updates the repository.content_id in the finalize phase!
repository = ::Katello::Repository.find(input[:repository_id])
if repository.root.deb_using_structured_apt?
if repository.deb_using_structured_apt?
content_url += repository.deb_content_url_options
end
end
Expand Down
2 changes: 1 addition & 1 deletion app/lib/actions/katello/product/content_destroy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def plan(repository)
::Katello::ProductContent.where(product_id: root_repository.product_id,
content_id: katello_content_id).destroy_all

if root_repository.repositories.count <= 1 || root_repository.deb_using_structured_apt?
if root_repository.repositories.count <= 1 || repository.deb_using_structured_apt?
plan_action(Candlepin::Product::ContentDestroy,
owner: root_repository.product.organization.label,
content_id: repository.content_id)
Expand Down
2 changes: 1 addition & 1 deletion app/lib/actions/katello/repository/clone_contents.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def plan(source_repositories, new_repository, options)
index_options = {id: new_repository.id, force_index: true}
index_options[:source_repository_id] = source_repositories.first.id if source_repositories.count == 1 && filters.empty? && rpm_filenames.nil?

if new_repository.root.deb_using_structured_apt? && generate_metadata
if new_repository.deb_using_structured_apt? && generate_metadata
plan_action(Candlepin::Product::ContentUpdate,
owner: new_repository.organization.label,
repository_id: new_repository.id,
Expand Down
2 changes: 1 addition & 1 deletion app/lib/actions/katello/repository/create.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def humanized_name
end

def create_content?(repository, clone)
if repository.root.deb_using_structured_apt?
if repository.deb_using_structured_apt?
return true
elsif clone || repository.content
return false
Expand Down
2 changes: 1 addition & 1 deletion app/lib/actions/katello/repository/finish_upload.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def plan(repository, options = {})
generate_metadata = options.fetch(:generate_metadata, true)
plan_action(Katello::Repository::MetadataGenerate, repository, :dependency => import_upload_task, :force_publication => true) if generate_metadata

if repository.root.deb_using_structured_apt? && generate_metadata
if repository.deb_using_structured_apt? && generate_metadata
plan_action(::Actions::Candlepin::Product::ContentUpdate,
owner: repository.organization.label,
repository_id: repository.id,
Expand Down
2 changes: 1 addition & 1 deletion app/lib/actions/katello/repository/sync.rb
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def presenter
end

def update_deb_content(repo)
return unless repo.root.deb_using_structured_apt?
return unless repo.deb_using_structured_apt?

plan_action(::Actions::Candlepin::Product::ContentUpdate,
owner: repo.organization.label,
Expand Down
2 changes: 1 addition & 1 deletion app/models/katello/repository.rb
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ class Repository < Katello::Model
scoped_search :on => :label, :relation => :root, :complete_value => true, :only_explicit => true
scoped_search :on => :content_label, :ext_method => :search_by_content_label, :default_operator => :like

delegate :product, :redhat?, :custom?, :to => :root
delegate :product, :redhat?, :custom?, :deb_using_structured_apt?, :to => :root
delegate :yum?, :docker?, :deb?, :file?, :ostree?, :ansible_collection?, :generic?, :to => :root
delegate :name, :label, :docker_upstream_name, :url, :download_concurrency, :to => :root

Expand Down
4 changes: 2 additions & 2 deletions app/services/katello/pulp3/repository/apt.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def sync_url_params(sync_options)
end

def mirror_remote_options
distributions = if repo.root.deb_using_structured_apt?
distributions = if repo.deb_using_structured_apt?
repo.deb_pulp_distributions.join(' ')
else
'default'
Expand All @@ -52,7 +52,7 @@ def publication_options(repository)
ss = api.signing_services_api.list(name: SIGNING_SERVICE_NAME).results
popts = super(repository)
popts.merge!({ structured: true })
popts.merge!({ simple: true }) unless repository.root.deb_using_structured_apt?
popts.merge!({ simple: true }) unless repository.deb_using_structured_apt?
popts[:signing_service] = ss[0].pulp_href if ss && ss.length == 1
popts
end
Expand Down

0 comments on commit 7e8cb01

Please sign in to comment.