]> git.michaelhowe.org Git - packages/n/nagios-plugins-local.git/commitdiff
Strip trailing spaces from mdadm output
authorMichael Howe <michael.howe@it.ox.ac.uk>
Wed, 6 Sep 2017 18:01:59 +0000 (19:01 +0100)
committerMichael Howe <michael.howe@it.ox.ac.uk>
Wed, 6 Sep 2017 18:01:59 +0000 (19:01 +0100)
This changed in stretch, and broke check_md_raid.  Adding rstrip()
makes things happier.

debian/changelog
plugins/check_md_raid

index a325b557a16b3146f687de7f5a28d4b9f7516849..a4daee4d696a15e4832928a6c31af3b12708c469 100644 (file)
@@ -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 <michael.howe@it.ox.ac.uk>  Wed, 06 Sep 2017 19:00:00 +0100
+
 nagios-plugins-local (0.14) unstable; urgency=low
 
   * nagios-plugins-local-server:
index 5788da48098d568ef955d471e19e9e00a0ad2e03..ee3109e14fedab7cf989d695cf28ff82158d39cf 100755 (executable)
@@ -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