summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: cb7358b)
raw | patch | inline | side by side (parent: cb7358b)
author | Sven Velt <sven@velt.de> | |
Fri, 8 Jan 2010 13:48:12 +0000 (14:48 +0100) | ||
committer | Sven Velt <sven@velt.de> | |
Fri, 8 Jan 2010 13:48:12 +0000 (14:48 +0100) |
Until now command lines where split at spaces (" ") but if you want some
string arguments including spaces ("-e '220 mail.server.de'") this
doesn't work anymore. So now we use "shlex.split()" for this.
string arguments including spaces ("-e '220 mail.server.de'") this
doesn't work anymore. So now we use "shlex.split()" for this.
nagixsc_conf2xml.py | patch | blob | history |
diff --git a/nagixsc_conf2xml.py b/nagixsc_conf2xml.py
index 029fa3fe2f6fd1692a8d8212cfae55f6c785bfa9..d1ae4a8c9cbe351a0eda691d793c7b878f7e2af2 100755 (executable)
--- a/nagixsc_conf2xml.py
+++ b/nagixsc_conf2xml.py
import ConfigParser
import optparse
+import shlex
import subprocess
import sys
def exec_check(host_name, service_descr, cmdline):
try:
- cmd = subprocess.Popen(cmdline.split(' '), stdout=subprocess.PIPE)
+ cmd = subprocess.Popen(shlex.split(cmdline), stdout=subprocess.PIPE)
output = cmd.communicate()[0].rstrip()
retcode = cmd.returncode
except OSError: