bodewig 2003/10/29 07:02:43
Modified: src/main/org/apache/tools/ant/taskdefs/optional/ssh
SSHExec.java
Log:
timeout should result in build failure.
PR: 24170
Submitted by: Edwin Steele <Edwin underscore STEELE at rta dot nsw dot gov
dot au>
Revision Changes Path
1.11 +11 -3
ant/src/main/org/apache/tools/ant/taskdefs/optional/ssh/SSHExec.java
Index: SSHExec.java
===================================================================
RCS file:
/home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/ssh/SSHExec.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- SSHExec.java 24 Oct 2003 08:49:11 -0000 1.10
+++ SSHExec.java 29 Oct 2003 15:02:43 -0000 1.11
@@ -209,7 +209,11 @@
if (thread.isAlive()) {
// ran out of time
thread = null;
- log(TIMEOUT_MESSAGE, Project.MSG_ERR);
+ if (getFailonerror()) {
+ throw new BuildException(TIMEOUT_MESSAGE);
+ } else {
+ log(TIMEOUT_MESSAGE, Project.MSG_ERR);
+ }
} else {
// completed successfully
if (outputProperty != null) {
@@ -235,7 +239,11 @@
throw e;
} catch (JSchException e) {
if (e.getMessage().indexOf("session is down") >= 0) {
- log(TIMEOUT_MESSAGE, Project.MSG_ERR);
+ if (getFailonerror()) {
+ throw new BuildException(TIMEOUT_MESSAGE, e);
+ } else {
+ log(TIMEOUT_MESSAGE, Project.MSG_ERR);
+ }
} else {
if (getFailonerror()) {
throw new BuildException(e);
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]