From 04a8ebf351efe40b5b7d2bf786e7b1f2d10a85fb Mon Sep 17 00:00:00 2001 From: SwampdogMash <35781133+swampdogmash@users.noreply.github.com> Date: Tue, 28 May 2024 16:45:06 +0100 Subject: [PATCH] Update yum.py Noticed tabs instead of spaces causing validation errors. --- lib/python3/cmk/base/plugins/agent_based/yum.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/python3/cmk/base/plugins/agent_based/yum.py b/lib/python3/cmk/base/plugins/agent_based/yum.py index 46edcea..7839d5f 100644 --- a/lib/python3/cmk/base/plugins/agent_based/yum.py +++ b/lib/python3/cmk/base/plugins/agent_based/yum.py @@ -123,7 +123,7 @@ def check_yum(params: Dict[str, int], section: Section): yield Metric(name="normal_updates", value=section.packages) # If there are no updates available, but we haven't been able to check security updates, still return # a metric value of zero - elif section.packages == 0: + elif section.packages == 0: yield Result(state=State.OK, summary=f"{section.packages} updates available") yield Metric(name="normal_updates", value=section.packages) @@ -131,15 +131,15 @@ def check_yum(params: Dict[str, int], section: Section): # Check the status of the returned number of updates that are security updates including # error condition and if there are no updates or the security updates check is not possible # First check if ANY updates were flagged as security updates and report the metric - if section.security_packages >= 0: + if section.security_packages >= 0: yield Result(state=State(params.get("security", 0)), summary=f"{section.security_packages} security updates available") yield Metric(name="security_updates", value=section.security_packages) # If there are no updates available, report this - elif section.security_packages == 0: + elif section.security_packages == 0: yield Result(state=State.OK, summary=f"{section.security_packages} security updates available") yield Metric(name="security_updates", value=section.security_packages) #If the agent reported that security update was not available, return this with a report of 0 updates - elif section.security_packages == -2: + elif section.security_packages == -2: yield Result(state=State.OK, summary='Security update check not available') yield Metric(name="security_updates", value=0) # If the security update check failed with an error, report this AND a value of zero