forked from Katello/katello
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PR] Fixes #25978 - debian errata support
Co-Authored-by: Markus Bucher <[email protected]> Co-Authored-by: Bernhard Suttner <[email protected]> Co-Authored-by: Manisha Singhal <[email protected]> from Katello#7961
- Loading branch information
1 parent
20f0ebc
commit 552a759
Showing
55 changed files
with
3,643 additions
and
3,491 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
module Actions | ||
module Katello | ||
module Repository | ||
class CopyDebErratum < Actions::Base | ||
input_format do | ||
param :source_repo_id | ||
param :target_repo_id | ||
param :erratum_ids | ||
param :clean_target_errata | ||
end | ||
|
||
def run | ||
target_repo = ::Katello::Repository.find(input[:target_repo_id]) | ||
|
||
# drop all existing errata from target_repo (e.g. promoting LCENV back to an earlier version) | ||
target_repo.repository_errata.destroy_all if input[:clean_target_errata] == true | ||
|
||
erratum_ids_to_copy = [] | ||
if input[:source_repo_id].present? | ||
erratum_ids_to_copy = ::Katello::Repository.find(input[:source_repo_id])&.erratum_ids | ||
elsif input[:erratum_ids].present? | ||
erratum_ids_to_copy = ::Katello::Erratum.where(errata_id: input[:erratum_ids]).pluck(:id) | ||
end | ||
erratum_ids_to_copy -= target_repo.erratum_ids | ||
target_repo.erratum_ids |= erratum_ids_to_copy | ||
target_repo.save | ||
|
||
# fake output to make foreman task presenter happy | ||
if input[:erratum_ids].present? | ||
units = [] | ||
::Katello::Erratum.find(erratum_ids_to_copy).each do |erratum| | ||
units << { 'type_id' => 'erratum', 'unit_key' => { 'id' => erratum.pulp_id } } | ||
erratum.deb_packages.map do |pkg| | ||
units << { 'type_id' => 'deb', 'unit_key' => { 'name' => pkg.name, 'version' => pkg.version } } | ||
end | ||
end | ||
output[:pulp_tasks] = [{ :result => { :units_successful => units } }] | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.