Skip to content

Commit 71d1305

Browse files
Shu JiamingLeemoonsoo
authored andcommitted
[ZEPPELIN-2841] fix a problem in shell interpreter . Working directory '.' can not be found in docker environment
### What is this PR for? shell interpreter complained that working directory '.' can not be found in docker environment. I add a line of code to set current working directory to USER`s home, and it works. ### What type of PR is it? Bug Fix ### Todos * tests ### What is the Jira issue? https://issues.apache.org/jira/browse/ZEPPELIN-2841 ### How should this be tested? run shell interpreter`s test units ### Screenshots (if appropriate) ### Questions: * Does the licenses files need update? No * Is there breaking changes for older versions? No * Does this needs documentation? No Author: Shu Jiaming <[email protected]> Author: 束佳明 <[email protected]> Closes apache#2521 from vistep/master and squashes the following commits: 34a0049 [Shu Jiaming] ZEPPELIN-2841 fix a bug where shell interpreter complained that working directory '.' can not be found while zeppelin was running in docker enviroment. d02104a [束佳明] Merge pull request #1 from apache/master
1 parent 7f2f67b commit 71d1305

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

shell/src/main/java/org/apache/zeppelin/shell/ShellInterpreter.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import java.io.ByteArrayOutputStream;
2121
import java.io.IOException;
2222
import java.io.OutputStream;
23+
import java.io.File;
2324
import java.util.List;
2425
import java.util.Properties;
2526
import java.util.concurrent.ConcurrentHashMap;
@@ -98,6 +99,7 @@ public InterpreterResult interpret(String cmd, InterpreterContext contextInterpr
9899
contextInterpreter.out, contextInterpreter.out));
99100
executor.setWatchdog(new ExecuteWatchdog(Long.valueOf(getProperty(TIMEOUT_PROPERTY))));
100101
executors.put(contextInterpreter.getParagraphId(), executor);
102+
executor.setWorkingDirectory(new File(System.getProperty("user.home")));
101103
int exitVal = executor.execute(cmdLine);
102104
LOGGER.info("Paragraph " + contextInterpreter.getParagraphId()
103105
+ " return with exit value: " + exitVal);

0 commit comments

Comments
 (0)