Skip to content

Commit

Permalink
Fixes #36182 - Error generating host applied errata report (#10482)
Browse files Browse the repository at this point in the history
- Use get_task_input to fetch task input.
- Skip invalid/deleted errata to prevent error.
  • Loading branch information
hao-yu committed Mar 10, 2023
1 parent e17daaf commit 4b34cad
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions app/lib/katello/concerns/base_template_scope_extensions.rb
Expand Up @@ -245,10 +245,12 @@ def load_errata_applications(filter_errata_type: nil, include_last_reboot: 'yes'

batch.each do |task|
next if skip_task?(task)
next unless only_host_ids.nil? || only_host_ids.include?(task.input['host']['id'].to_i)
next unless only_host_ids.nil? || only_host_ids.include?(get_task_input(task)['host']['id'].to_i)
parse_errata(task).each do |erratum_id|
current_erratum_errata_type = preloaded_errata.find { |k, _| k == erratum_id }[1]
current_erratum_issued = preloaded_errata.find { |k, _| k == erratum_id }.last
current_erratum = preloaded_errata.find { |k, _| k == erratum_id }
next if current_erratum.nil?
current_erratum_errata_type = current_erratum[1]
current_erratum_issued = current_erratum.last

if filter_errata_type != 'all'
next unless filter_errata_type == current_erratum_errata_type
Expand Down

0 comments on commit 4b34cad

Please sign in to comment.