From 812ff7aac5a163ed95b1eb6a209a55edd8bbdd1d Mon Sep 17 00:00:00 2001 From: David Anderson Date: Sat, 6 Dec 2014 21:14:27 -0800 Subject: [PATCH] ceph: respect the PYTHON environment variable for dev mode. On OSes where `python` is python3, dev mode's re-exec makes the ceph tool fail. The standard way to fix this is by exporting the PYTHON envvar pointing to the python2 interpreter. Signed-off-by: Dave Anderson --- src/ceph.in | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ceph.in b/src/ceph.in index d133557669c6d..654148fba391f 100755 --- a/src/ceph.in +++ b/src/ceph.in @@ -40,16 +40,17 @@ if MYDIR.endswith('src') and \ else: lib_path_var = "LD_LIBRARY_PATH" + py_binary = os.environ.get("PYTHON", "python") MYLIBPATH = os.path.join(MYDIR, '.libs') if lib_path_var in os.environ: if MYLIBPATH not in os.environ[lib_path_var]: os.environ[lib_path_var] += ':' + MYLIBPATH print >> sys.stderr, DEVMODEMSG - os.execvp('python', ['python'] + sys.argv) + os.execvp(py_binary, ['python'] + sys.argv) else: os.environ[lib_path_var] = MYLIBPATH print >> sys.stderr, DEVMODEMSG - os.execvp('python', ['python'] + sys.argv) + os.execvp(py_binary, ['python'] + sys.argv) sys.path.insert(0, os.path.join(MYDIR, 'pybind')) if os.environ.has_key('PATH') and MYDIR not in os.environ['PATH']: os.environ['PATH'] += ':' + MYDIR -- 2.39.5