Commit 74256682 authored by Julien Muchembled's avatar Julien Muchembled

cloudooo: do not use 'Popen(shell=True, ...)'

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk/utils@41310 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 89af0938
......@@ -59,14 +59,14 @@ class OpenOffice(Application):
"""Test if OpenOffice was started correctly"""
logger.debug("Test OpenOffice %s - Pid %s" % (self.getAddress()[-1],
self.pid()))
command = [join(self.office_binary_path, "python"),
args = [join(self.office_binary_path, "python"),
pkg_resources.resource_filename("cloudooo",
join("helper", "openoffice_tester.py")),
"'--hostname=%s'" % host,
"'--port=%s'" % port,
"'--uno_path=%s'" % self.uno_path]
"--hostname=%s" % host,
"--port=%s" % port,
"--uno_path=%s" % self.uno_path]
logger.debug("Testing Openoffice Instance %s" % port)
stdout, stderr = Popen(" ".join(command), shell=True, stdout=PIPE,
stdout, stderr = Popen(args, stdout=PIPE,
stderr=PIPE, close_fds=True).communicate()
stdout_bool = convertStringToBool(stdout.replace("\n", ""))
if stdout_bool and stderr != "":
......
......@@ -107,17 +107,16 @@ class MimeMapper(object):
uno_path = kw.get("uno_path", environ.get('uno_path'))
office_binary_path = kw.get("office_binary_path",
environ.get('office_binary_path'))
command = [path.join(office_binary_path, "python"),
args = [path.join(office_binary_path, "python"),
pkg_resources.resource_filename(__name__,
path.join("helper", "unomimemapper.py")),
"--uno_path='%s'" % uno_path,
"--office_binary_path='%s'" % office_binary_path,
"--hostname='%s'" % hostname,
"--uno_path=%s" % uno_path,
"--office_binary_path=%s" % office_binary_path,
"--hostname=%s" % hostname,
"--port=%s" % port]
stdout, stderr = Popen(' '.join(command),
stdout, stderr = Popen(args,
stdout=PIPE,
close_fds=True,
shell=True,
env=getCleanPythonEnvironment()).communicate()
exec(stdout)
for key, value in filter_dict.iteritems():
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment