modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/Status.java
| 12 +++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
New commits:
commit dc69e64b584f0534f5af8e1efac9b29db95cffca
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Tue Apr 30 10:17:51 2013 -0400
Fix 'rhqctl status' for windows, avoid throwing exception on aganet check
diff --git
a/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/Status.java
b/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/Status.java
index 478b142..b11d23f 100644
---
a/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/Status.java
+++
b/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/Status.java
@@ -31,6 +31,7 @@ import java.io.FileReader;
import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.Options;
import org.apache.commons.exec.DefaultExecutor;
+import org.apache.commons.exec.ExecuteException;
import org.apache.commons.exec.Executor;
import org.apache.commons.exec.PumpStreamHandler;
@@ -159,6 +160,15 @@ public class Status extends ControlCommand {
Executor executor = new DefaultExecutor();
executor.setWorkingDirectory(agentBinDir);
executor.setStreamHandler(new PumpStreamHandler());
- executor.execute(commandLine);
+ try {
+ executor.execute(commandLine);
+ } catch (ExecuteException e) {
+ // For windows the JSW exit code for a status check is expected to be a mask
value and the agent wrapper
+ // .bat will return it explicitly. We can ignore it and assume that the
logged output is sufficient.
+ // See
http://wrapper.tanukisoftware.com/doc/english/launch-win.html#standalone-...
+ if (!isWindows()) {
+ throw e;
+ }
+ }
}
}