From 27eedff67e66f8db3a6a392d07e0a6141459170d Mon Sep 17 00:00:00 2001
From: jvergara <jvergara@localhost>
Date: Thu, 31 Jan 2008 03:22:09 +0000
Subject: [PATCH] Fix for issue 2887 (Command bin/status exit status 0 despite connection errors being reported.).
---
opendj-sdk/opends/src/guitools/org/opends/guitools/statuspanel/StatusCli.java | 16 ++++++++++++++--
1 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/opendj-sdk/opends/src/guitools/org/opends/guitools/statuspanel/StatusCli.java b/opendj-sdk/opends/src/guitools/org/opends/guitools/statuspanel/StatusCli.java
index 98956db..1e7dcb3 100644
--- a/opendj-sdk/opends/src/guitools/org/opends/guitools/statuspanel/StatusCli.java
+++ b/opendj-sdk/opends/src/guitools/org/opends/guitools/statuspanel/StatusCli.java
@@ -22,7 +22,7 @@
* CDDL HEADER END
*
*
- * Portions Copyright 2007 Sun Microsystems, Inc.
+ * Portions Copyright 2007-2008 Sun Microsystems, Inc.
*/
package org.opends.guitools.statuspanel;
@@ -119,7 +119,12 @@
* User cancelled (for instance not accepting the certificate proposed) or
* could not use the provided connection parameters in interactive mode.
*/
- USER_CANCELLED_OR_DATA_ERROR(3);
+ USER_CANCELLED_OR_DATA_ERROR(3),
+ /**
+ * This occurs for instance when the authentication provided by the user is
+ * not valid.
+ */
+ ERROR_READING_CONFIGURATION_WITH_LDAP(4);
private int returnCode;
private ErrorReturnCode(int returnCode)
@@ -430,6 +435,12 @@
onLineConf.readConfiguration();
updateDescriptorWithOnLineInfo(desc, onLineConf);
writeStatus(desc);
+
+ if (desc.getErrorMessage() != null)
+ {
+ return ErrorReturnCode.ERROR_READING_CONFIGURATION_WITH_LDAP.
+ getReturnCode();
+ }
}
else
{
@@ -443,6 +454,7 @@
{
println();
println(ce.getMessageObject());
+ return ErrorReturnCode.USER_CANCELLED_OR_DATA_ERROR.getReturnCode();
}
}
--
Gitblit v1.10.0