correctly handle zeppelin.python property.

This commit is contained in:
Lee moon soo 2017-03-18 10:07:01 -07:00
parent 5be8db4479
commit 3e6603b163
2 changed files with 14 additions and 4 deletions

View file

@ -89,8 +89,9 @@ public class PythonDockerInterpreter extends Interpreter {
mountPythonScript +
mountPy4j +
"-e PYTHONPATH=\"" + pythonPath + "\" " +
image +
" python /_zeppelin_tmp/" + pythonScript.getName());
image + " " +
getPythonInterpreter().getPythonBindPath() + " " +
"/_zeppelin_tmp/" + pythonScript.getName());
restartPythonProcess();
out.clear();
return new InterpreterResult(InterpreterResult.Code.SUCCESS, "\"" + image + "\" activated");

View file

@ -444,14 +444,23 @@ public class PythonInterpreter extends Interpreter implements ExecuteResultHandl
pythonCommand = cmd;
}
public String getPythonCommand() {
private String getPythonCommand() {
if (pythonCommand == null) {
return DEFAULT_ZEPPELIN_PYTHON;
return getPythonBindPath();
} else {
return pythonCommand;
}
}
public String getPythonBindPath() {
String path = getProperty("zeppelin.python");
if (path == null) {
return DEFAULT_ZEPPELIN_PYTHON;
} else {
return path;
}
}
private Job getRunningJob(String paragraphId) {
Job foundJob = null;
Collection<Job> jobsRunning = getScheduler().getJobsRunning();