Commit 56ac38ad authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

existing environment variables should not affect cloudooo. if some enviroment...

existing environment variables should not affect cloudooo. if some enviroment variables should be set, we should improve cloudooo so that it can accepts such parameters in its configuration file.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk/utils@42080 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 29d544c6
...@@ -40,7 +40,6 @@ from cloudooo.utils.utils import logger, convertStringToBool ...@@ -40,7 +40,6 @@ from cloudooo.utils.utils import logger, convertStringToBool
from cloudooo.handler.ooo.utils.utils import waitStartDaemon, \ from cloudooo.handler.ooo.utils.utils import waitStartDaemon, \
removeDirectory, waitStopDaemon, \ removeDirectory, waitStopDaemon, \
socketStatus socketStatus
from cloudooo.utils.utils import getCleanPythonEnvironment
class OpenOffice(Application): class OpenOffice(Application):
"""Object to control one OOo Instance and all features instance.""" """Object to control one OOo Instance and all features instance."""
...@@ -145,7 +144,7 @@ class OpenOffice(Application): ...@@ -145,7 +144,7 @@ class OpenOffice(Application):
] ]
# To run the instance OOo is need a environment. So, the "DISPLAY" of Xvfb # To run the instance OOo is need a environment. So, the "DISPLAY" of Xvfb
# is passed to env and the environment customized is passed to the process # is passed to env and the environment customized is passed to the process
env = getCleanPythonEnvironment() env = {}
env["HOME"] = self.path_user_installation env["HOME"] = self.path_user_installation
env["TMP"] = self.path_user_installation env["TMP"] = self.path_user_installation
env["TMPDIR"] = self.path_user_installation env["TMPDIR"] = self.path_user_installation
......
...@@ -34,7 +34,6 @@ from filter import Filter ...@@ -34,7 +34,6 @@ from filter import Filter
from os import environ, path from os import environ, path
from cloudooo.interfaces.mimemapper import IMimemapper from cloudooo.interfaces.mimemapper import IMimemapper
from types import InstanceType from types import InstanceType
from cloudooo.utils.utils import getCleanPythonEnvironment
import json import json
...@@ -120,8 +119,7 @@ class MimeMapper(object): ...@@ -120,8 +119,7 @@ class MimeMapper(object):
stdout, stderr = Popen(command, stdout, stderr = Popen(command,
stdout=PIPE, stdout=PIPE,
close_fds=True, close_fds=True).communicate()
env=getCleanPythonEnvironment()).communicate()
filter_dict, type_dict = json.loads(stdout) filter_dict, type_dict = json.loads(stdout)
for filter_name, value in filter_dict.iteritems(): for filter_name, value in filter_dict.iteritems():
flag = value.get("Flags") flag = value.get("Flags")
......
...@@ -51,14 +51,6 @@ PYTHON_ENVIRONMENT = [ ...@@ -51,14 +51,6 @@ PYTHON_ENVIRONMENT = [
] ]
def getCleanPythonEnvironment():
env = environ.copy()
# Clean python related environment variables
for k in PYTHON_ENVIRONMENT:
env.pop(k, None)
return env
def removeDirectory(path): def removeDirectory(path):
"""Remove directory""" """Remove directory"""
try: try:
......
...@@ -47,14 +47,6 @@ PYTHON_ENVIRONMENT = [ ...@@ -47,14 +47,6 @@ PYTHON_ENVIRONMENT = [
] ]
def getCleanPythonEnvironment():
env = environ.copy()
# Clean python related environment variables
for k in PYTHON_ENVIRONMENT:
env.pop(k, None)
return env
def configureLogger(level=None, debug_mode=False): def configureLogger(level=None, debug_mode=False):
"""Configure logger. """Configure logger.
Keyword arguments: Keyword arguments:
......
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