Federico Simoncelli has uploaded a new change for review.
Change subject: remoteFileHandler: improve PYTHONPATH definition
......................................................................
remoteFileHandler: improve PYTHONPATH definition
The recently added import for logUtils in misc.py broke the out of
process (remoteFileHandler) subsystem (ImportError: No module named
logUtils).
Defining PYTHONPATH with relative paths is both unreliable and
insecure.
In this patch:
* Remove an old sys.path modification in misc.py
* Improve the PYTHONPATH definition in remoteFileHandler removing the
relative path
Change-Id: I29dd748bcc9658a98ad86313921bfd94c96b83a6
Signed-off-by: Federico Simoncelli <fsimonce(a)redhat.com>
---
M vdsm/storage/misc.py
M vdsm/storage/remoteFileHandler.py
2 files changed, 2 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/93/9193/1
diff --git a/vdsm/storage/misc.py b/vdsm/storage/misc.py
index bf3ae79..7453b7f 100644
--- a/vdsm/storage/misc.py
+++ b/vdsm/storage/misc.py
@@ -55,7 +55,6 @@
import fcntl
import inspect
-sys.path.append("../")
from vdsm import constants
import storage_exception as se
from vdsm.betterPopen import BetterPopen
diff --git a/vdsm/storage/remoteFileHandler.py b/vdsm/storage/remoteFileHandler.py
index edf8e68..933dc82 100644
--- a/vdsm/storage/remoteFileHandler.py
+++ b/vdsm/storage/remoteFileHandler.py
@@ -220,7 +220,8 @@
try:
# Some imports in vdsm assume /usr/share/vdsm is in your PYTHONPATH
env = os.environ.copy()
- env['PYTHONPATH'] = "../:" + env.get('PYTHONPATH',
"")
+ env['PYTHONPATH'] = "%s:%s" % (
+ constants.P_VDSM, env.get("PYTHONPATH"]))
self.process = BetterPopen([constants.EXT_PYTHON, __file__,
str(hisRead), str(hisWrite)], close_fds=False, env=env)
--
To view, visit
http://gerrit.ovirt.org/9193
To unsubscribe, visit
http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I29dd748bcc9658a98ad86313921bfd94c96b83a6
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Federico Simoncelli <fsimonce(a)redhat.com>