Module: check_mk
Branch: master
Commit: f1eadda73a0a657eb60fbc3783de8885db679c7b
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f1eadda73a0a65…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Thu Dec 17 10:08:57 2015 +0100
local automation can now pass transparent stdin data
---
web/htdocs/watolib.py | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/web/htdocs/watolib.py b/web/htdocs/watolib.py
index b9eb853..3c5afe2 100644
--- a/web/htdocs/watolib.py
+++ b/web/htdocs/watolib.py
@@ -3805,7 +3805,7 @@ def check_mk_automation(siteid, command, args=[],
indata=""):
return check_mk_remote_automation(siteid, command, args, indata)
-def check_mk_local_automation(command, args=[], indata=""):
+def check_mk_local_automation(command, args=[], indata="", stdin_data=None):
# Gather the command to use for executing --automation calls to check_mk
# - First try to use the check_mk_automation option from the defaults
# - When not set try to detect the command for OMD or non OMD installations
@@ -3866,7 +3866,10 @@ def check_mk_local_automation(command, args=[],
indata=""):
raise MKGeneralException("Cannot execute <tt>%s</tt>:
%s<br><br>%s" % (commandargs[0], e, sudo_msg))
else:
raise MKGeneralException("Cannot execute <tt>%s</tt>:
%s" % (commandargs[0], e))
- p.stdin.write(repr(indata))
+ if stdin_data != None:
+ p.stdin.write(stdin_data)
+ else:
+ p.stdin.write(repr(indata))
p.stdin.close()
outdata = p.stdout.read()
exitcode = p.wait()