[Feature] AbstractCommandExecutor.commandType difficult to understand (#1833)

issue: https://github.com/apache/incubator-dolphinscheduler/issues/1831
This commit is contained in:
gabry.wu 2020-01-16 11:27:22 +08:00 committed by qiaozhanwei
parent c558da0b75
commit c531c88e7e
3 changed files with 4 additions and 4 deletions

View File

@ -207,7 +207,7 @@ public abstract class AbstractCommandExecutor {
// merge error information to standard output stream
processBuilder.redirectErrorStream(true);
// setting up user to run commands
processBuilder.command("sudo", "-u", tenantCode, commandType(), commandFile);
processBuilder.command("sudo", "-u", tenantCode, commandInterpreter(), commandFile);
process = processBuilder.start();
@ -561,7 +561,7 @@ public abstract class AbstractCommandExecutor {
protected abstract String buildCommandFilePath();
protected abstract String commandType();
protected abstract String commandInterpreter();
protected abstract boolean checkFindApp(String line);
protected abstract void createCommandFileIfNotExists(String execCommand, String commandFile) throws IOException;
}

View File

@ -113,7 +113,7 @@ public class PythonCommandExecutor extends AbstractCommandExecutor {
* @return python home
*/
@Override
protected String commandType() {
protected String commandInterpreter() {
String pythonHome = getPythonHome(envFile);
if (StringUtils.isEmpty(pythonHome)){
return PYTHON;

View File

@ -74,7 +74,7 @@ public class ShellCommandExecutor extends AbstractCommandExecutor {
* @return command type
*/
@Override
protected String commandType() {
protected String commandInterpreter() {
return SH;
}