Module: check_mk
Branch: master
Commit: 8273cfab1a6597ca3c1cc96bfcc8ffb204fc10da
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=8273cfab1a6597…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Apr 27 14:12:45 2016 +0200
fixed pylint errors in python notification scripts
---
notifications/asciimail | 12 ++++++------
notifications/mail | 12 ++++++------
2 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/notifications/asciimail b/notifications/asciimail
index 243f016..e43f323 100755
--- a/notifications/asciimail
+++ b/notifications/asciimail
@@ -173,7 +173,12 @@ def read_bulk_contexts():
# First comes a section with global variables
for line in sys.stdin:
line = line.strip()
- if line:
+
+ if not line:
+ in_params = False
+ context = {}
+ contexts.append(context)
+ else:
try:
key, value = line.split("=", 1)
value = value.replace("\1", "\n")
@@ -186,11 +191,6 @@ def read_bulk_contexts():
else:
context[key] = value
- else:
- in_params = False
- context = {}
- contexts.append(context)
-
return parameters, contexts
def main():
diff --git a/notifications/mail b/notifications/mail
index 0c01952..7ee3d43 100755
--- a/notifications/mail
+++ b/notifications/mail
@@ -730,7 +730,12 @@ def read_bulk_contexts():
# First comes a section with global variables
for line in sys.stdin:
line = line.strip()
- if line:
+
+ if not line:
+ in_params = False
+ context = {}
+ contexts.append(context)
+ else:
key, value = line.split("=", 1)
value = value.replace("\1", "\n")
if in_params:
@@ -738,11 +743,6 @@ def read_bulk_contexts():
else:
context[key] = value
- else:
- in_params = False
- context = {}
- contexts.append(context)
-
return parameters, contexts
def main():