|
|
@ -141,7 +141,6 @@ public class RemoteExecutor implements AutoCloseable { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
cleanData(taskId); |
|
|
|
cleanData(taskId); |
|
|
|
log.error("Remote shell task failed"); |
|
|
|
|
|
|
|
return exitCode; |
|
|
|
return exitCode; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -232,8 +231,10 @@ public class RemoteExecutor implements AutoCloseable { |
|
|
|
channel.open(); |
|
|
|
channel.open(); |
|
|
|
channel.waitFor(EnumSet.of(ClientChannelEvent.CLOSED), 0); |
|
|
|
channel.waitFor(EnumSet.of(ClientChannelEvent.CLOSED), 0); |
|
|
|
channel.close(); |
|
|
|
channel.close(); |
|
|
|
if (channel.getExitStatus() != 0) { |
|
|
|
Integer exitStatus = channel.getExitStatus(); |
|
|
|
throw new TaskException("Remote shell task error, error message: " + err.toString()); |
|
|
|
if (exitStatus == null || exitStatus != 0) { |
|
|
|
|
|
|
|
throw new TaskException( |
|
|
|
|
|
|
|
"Remote shell task error, exitStatus: " + exitStatus + " error message: " + err); |
|
|
|
} |
|
|
|
} |
|
|
|
return out.toString(); |
|
|
|
return out.toString(); |
|
|
|
} |
|
|
|
} |
|
|
|