From 34a00498d0a6283282b1016b4ffdcb660bb3508d Mon Sep 17 00:00:00 2001 From: Shu Jiaming Date: Wed, 9 Aug 2017 15:47:36 +0800 Subject: [PATCH] ZEPPELIN-2841 fix a bug where shell interpreter complained that working directory '.' can not be found while zeppelin was running in docker enviroment. --- .../main/java/org/apache/zeppelin/shell/ShellInterpreter.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/shell/src/main/java/org/apache/zeppelin/shell/ShellInterpreter.java b/shell/src/main/java/org/apache/zeppelin/shell/ShellInterpreter.java index 07eed5f9ef1..daad0b32886 100644 --- a/shell/src/main/java/org/apache/zeppelin/shell/ShellInterpreter.java +++ b/shell/src/main/java/org/apache/zeppelin/shell/ShellInterpreter.java @@ -20,6 +20,7 @@ import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.OutputStream; +import java.io.File; import java.util.List; import java.util.Properties; import java.util.concurrent.ConcurrentHashMap; @@ -98,6 +99,7 @@ public InterpreterResult interpret(String cmd, InterpreterContext contextInterpr contextInterpreter.out, contextInterpreter.out)); executor.setWatchdog(new ExecuteWatchdog(Long.valueOf(getProperty(TIMEOUT_PROPERTY)))); executors.put(contextInterpreter.getParagraphId(), executor); + executor.setWorkingDirectory(new File(System.getProperty("user.home"))); int exitVal = executor.execute(cmdLine); LOGGER.info("Paragraph " + contextInterpreter.getParagraphId() + " return with exit value: " + exitVal);