From 36e12978746ad9b9e54a1b9b871a2f9632207e8f Mon Sep 17 00:00:00 2001 From: Michael Howe Date: Wed, 6 Sep 2017 19:01:59 +0100 Subject: [PATCH] Strip trailing spaces from mdadm output This changed in stretch, and broke check_md_raid. Adding rstrip() makes things happier. --- debian/changelog | 7 +++++++ plugins/check_md_raid | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index a325b55..a4daee4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +nagios-plugins-local (0.15~test.0) UNRELEASED; urgency=medium + + * check_md_raid: + - strip trailing spaces from mdadm state + + -- Michael Howe Wed, 06 Sep 2017 19:00:00 +0100 + nagios-plugins-local (0.14) unstable; urgency=low * nagios-plugins-local-server: diff --git a/plugins/check_md_raid b/plugins/check_md_raid index 5788da4..ee3109e 100755 --- a/plugins/check_md_raid +++ b/plugins/check_md_raid @@ -108,7 +108,7 @@ def test_raid(verbosity): state = "unknown" for line in detailed_output: if "State :" in line: - state = line.split(":")[-1][1:-1] + state = line.split(":")[-1][1:-1].rstrip() re_clean = re.compile('^clean(, no-errors)?$') if not re_clean.match(state) and state != "active": arrays_not_ok += 1 -- 2.39.5