Skip to content
This repository has been archived by the owner on Jan 31, 2023. It is now read-only.

Deduct the excluded packages from the total output count #28

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions check_yum
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ class YumTester:
re_no_security_updates_available_rhel5 = re.compile("No packages needed, for security, \d+ available")
re_no_security_updates_available_rhel6 = re.compile("No packages needed for security; \d+ packages available")
summary_line_found = False
excluded = 0
for line in output:
if re_no_security_updates_available_rhel5.match(line):
summary_line_found = True
Expand All @@ -289,7 +290,9 @@ class YumTester:
number_security_updates = line.split()[0]
number_total_updates = line.split()[7]
break

if "excluded (updateinfo)" in line:
excluded += 1

if not summary_line_found:
end(WARNING, "Cannot find summary line in YUM output. Please make sure you have upgraded to the latest version of this plugin. If the problem persists, please contact the author for a fix")

Expand All @@ -301,7 +304,7 @@ class YumTester:

number_other_updates = number_total_updates - number_security_updates

if len(output) > number_total_updates + 25:
if ( len(output) - excluded ) > ( number_total_updates + 25 ):
end(WARNING, "YUM output signature is larger than current known format, please make sure you have upgraded to the latest version of this plugin. If the problem persists, please contact the author for a fix")

return number_security_updates, number_other_updates
Expand Down