From: Michael Howe Date: Wed, 6 Sep 2017 18:01:59 +0000 (+0100) Subject: Strip trailing spaces from mdadm output X-Git-Tag: 0.15~2 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=36e12978746ad9b9e54a1b9b871a2f9632207e8f;p=packages%2Fn%2Fnagios-plugins-local.git Strip trailing spaces from mdadm output This changed in stretch, and broke check_md_raid. Adding rstrip() makes things happier. --- 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