diff --git a/app/lib/actions/katello/content_view/incremental_updates.rb b/app/lib/actions/katello/content_view/incremental_updates.rb index bcc21538e1d..6d267d39ce9 100644 --- a/app/lib/actions/katello/content_view/incremental_updates.rb +++ b/app/lib/actions/katello/content_view/incremental_updates.rb @@ -81,6 +81,7 @@ def total_counts(input) if added_units total_count[:errata_count] = added_units[:erratum].try(:count) total_count[:rpm_count] = added_units[:rpm].try(:count) + total_count[:deb_count] = added_units[:deb].try(:count) total_count[:puppet_module_count] = added_units[:puppet_module].try(:count) end end @@ -121,6 +122,10 @@ def content_output_collection(total_count) rpm = _(" %{package_count} Package(s)" % {:package_count => total_count[:rpm_count]}) content << rpm end + if total_count[:deb_count] && total_count[:deb_count] > 0 + deb = _(" %{deb_package_count} Package(s)" % {:deb_package_count => total_count[:deb_count]}) + content << deb + end if total_count[:puppet_module_count] && total_count[:puppet_module_count] > 0 puppet_module = _(" %{puppet_module_count} Puppet Module(s)" % {:puppet_module_count => total_count[:puppet_module_count]}) diff --git a/app/lib/actions/katello/content_view/presenters/incremental_updates_presenter.rb b/app/lib/actions/katello/content_view/presenters/incremental_updates_presenter.rb index 48eaae8c166..01bd7f40c51 100644 --- a/app/lib/actions/katello/content_view/presenters/incremental_updates_presenter.rb +++ b/app/lib/actions/katello/content_view/presenters/incremental_updates_presenter.rb @@ -5,7 +5,8 @@ module Presenters class IncrementalUpdatesPresenter < Helpers::Presenter::Base HUMANIZED_TYPES = { ::Katello::Erratum::CONTENT_TYPE => "Errata", - ::Katello::Rpm::CONTENT_TYPE => "Packages", + ::Katello::Rpm::CONTENT_TYPE => "RPM Packages", + ::Katello::Deb::CONTENT_TYPE => "Deb Packages", ::Katello::PuppetModule::CONTENT_TYPE => "Puppet Modules" }.freeze @@ -25,7 +26,7 @@ def humanized_content if cvv humanized_lines << "Content View: #{cvv.content_view.name} version #{cvv.version}" humanized_lines << _("Added Content:") - [::Katello::Erratum, ::Katello::Rpm, ::Katello::PuppetModule].each do |content_type| + [::Katello::Erratum, ::Katello::Rpm, ::Katello::Deb, ::Katello::PuppetModule].each do |content_type| unless output[:added_units][content_type::CONTENT_TYPE].blank? humanized_lines << " #{HUMANIZED_TYPES[content_type::CONTENT_TYPE]}:" humanized_lines += output[:added_units][content_type::CONTENT_TYPE].sort.map { |unit| " #{unit}" } diff --git a/app/lib/actions/katello/content_view_version/incremental_update.rb b/app/lib/actions/katello/content_view_version/incremental_update.rb index f812e7dd8c1..9adf9eb571a 100644 --- a/app/lib/actions/katello/content_view_version/incremental_update.rb +++ b/app/lib/actions/katello/content_view_version/incremental_update.rb @@ -165,7 +165,7 @@ def calculate_components(old_version, new_components) def generate_description(version, content) humanized_lines = [] - [::Katello::Erratum, ::Katello::Rpm, ::Katello::PuppetModule].each do |content_type| + [::Katello::Erratum, ::Katello::Rpm, ::Katello::Deb, ::Katello::PuppetModule].each do |content_type| unless content[content_type::CONTENT_TYPE].blank? humanized_lines << "#{HUMANIZED_TYPES[content_type::CONTENT_TYPE]}:" humanized_lines += content[content_type::CONTENT_TYPE].sort.map { |unit| " #{unit}" } @@ -219,10 +219,10 @@ def copy_deb_content(new_repo, dep_solve, deb_ids, erratum_ids) copy_outputs = [] if new_repo.content_type == ::Katello::Repository::DEB_TYPE unless erratum_ids.blank? - plan_action(Katello::Repository::CopyDebErratum, - source_repo_id: new_repo.library_instance.id, - target_repo_id: new_repo.id, - erratum_ids: erratum_ids) + copy_outputs << plan_action(Katello::Repository::CopyDebErratum, + source_repo_id: new_repo.library_instance.id, + target_repo_id: new_repo.id, + erratum_ids: erratum_ids).output end unless deb_ids.blank? diff --git a/app/lib/actions/katello/repository/copy_deb_erratum.rb b/app/lib/actions/katello/repository/copy_deb_erratum.rb index e3c6c9b6a30..0137ce5c496 100644 --- a/app/lib/actions/katello/repository/copy_deb_erratum.rb +++ b/app/lib/actions/katello/repository/copy_deb_erratum.rb @@ -18,7 +18,11 @@ def run erratum_ids_to_copy -= target_repo.erratum_ids target_repo.erratum_ids |= erratum_ids_to_copy target_repo.save - output = erratum_ids_to_copy + + # fake output to make foreman task presenter happy + if erratum_ids + output[:pulp_tasks] = [{ :result => { :units_successful => ::Katello::Erratum.where(:id => erratum_ids_to_copy).pluck(:errata_id).map { |errata| { "type_id" => "erratum", "unit_key" => { id: errata }}} }}] + end end end end