Module: check_mk
Branch: master
Commit: f001bde0d81993870ef83bd36f50a9741ccc830d
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f001bde0d81993…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Thu Oct 25 16:16:39 2018 +0200
Unbreak bandit tests a bit.
Bandit is still a bit picky about the exact line where a "nosec" pragma must
appear, and YAPF broke that.
Change-Id: I0676485823c6c7d6860772e68032f582e1563342
---
cmk_base/data_sources/programs.py | 8 ++++----
cmk_base/donate.py | 4 ++--
cmk_base/notify.py | 4 ++--
3 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/cmk_base/data_sources/programs.py b/cmk_base/data_sources/programs.py
index 4fbe737..73d0955 100644
--- a/cmk_base/data_sources/programs.py
+++ b/cmk_base/data_sources/programs.py
@@ -66,10 +66,10 @@ class ProgramDataSource(CheckMKAgentDataSource):
p = None
try:
if config.monitoring_core == "cmc":
- p = subprocess.Popen(
+ p = subprocess.Popen( # nosec
commandline,
shell=True,
- stdin=open(os.devnull), # nosec
+ stdin=open(os.devnull),
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
preexec_fn=os.setsid,
@@ -78,10 +78,10 @@ class ProgramDataSource(CheckMKAgentDataSource):
# We can not create a separate process group when running Nagios
# Upon reaching the service_check_timeout Nagios only kills the process
# group of the active check.
- p = subprocess.Popen(
+ p = subprocess.Popen( # nosec
commandline,
shell=True,
- stdin=open(os.devnull), # nosec
+ stdin=open(os.devnull),
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
close_fds=True)
diff --git a/cmk_base/donate.py b/cmk_base/donate.py
index c298f89..5d3c30e 100644
--- a/cmk_base/donate.py
+++ b/cmk_base/donate.py
@@ -49,8 +49,8 @@ def do_donation():
console.verbose("Donating files %s\n" % " ".join(cache_files))
indata = base64.b64encode(
- os.popen(
- "tar czf - -C %s %s" % (cmk.paths.tcp_cache_dir, "
".join(donate))).read()) # nosec
+ os.popen( # nosec
+ "tar czf - -C %s %s" % (cmk.paths.tcp_cache_dir, "
".join(donate))).read())
output = os.popen(config.donation_command, "w") # nosec
output.write("\n\n@STARTDATA\n")
diff --git a/cmk_base/notify.py b/cmk_base/notify.py
index b794922..2f6f6b1 100755
--- a/cmk_base/notify.py
+++ b/cmk_base/notify.py
@@ -1225,10 +1225,10 @@ def notify_via_email(plugin_context):
notify_log_debug("Executing command: %s" % command)
# TODO: Cleanup this shell=True call!
- p = subprocess.Popen(
+ p = subprocess.Popen( # nosec
command_utf8,
shell=True,
- stdout=subprocess.PIPE, # nosec
+ stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
stdin=subprocess.PIPE,
close_fds=True)