Update dolphinscheduler-task-plugin/dolphinscheduler-task-remoteshell/src/main/java/org/apache/dolphinscheduler/plugin/task/remoteshell/RemoteExecutor.java

Co-authored-by: Wenjun Ruan <wenjun@apache.org>
This commit is contained in:
Zzih96 2024-04-26 11:25:37 +08:00 committed by Wenjun Ruan
parent a137b6e8ac
commit eb73f6ddf3
1 changed files with 1 additions and 3 deletions

View File

@ -131,9 +131,7 @@ public class RemoteExecutor implements AutoCloseable {
int exitCode = -1;
log.info("Remote shell task run status: {}", logLine);
if (logLine.contains(STATUS_TAG_MESSAGE)) {
int startIndex = logLine.indexOf(STATUS_TAG_MESSAGE) + STATUS_TAG_MESSAGE.length();
int endIndex = logLine.length();
String status = logLine.substring(startIndex, endIndex);
String status = StringUtils.substringAfter(logLine, STATUS_TAG_MESSAGE);
if (status.equals("0")) {
log.info("Remote shell task success");
exitCode = 0;