From a8be62629a05cca6809657e76ae587381da71f76 Mon Sep 17 00:00:00 2001
From: lutoff <lutoff@localhost>
Date: Thu, 03 Apr 2008 15:01:44 +0000
Subject: [PATCH] Fix for issue #2594 (list-backends CLI should not return 0 when basedn has a wrong value)
---
opends/tests/unit-tests-testng/src/server/org/opends/server/tools/ListBackendsTestCase.java | 2 +-
opends/src/server/org/opends/server/tools/ListBackends.java | 4 +++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/opends/src/server/org/opends/server/tools/ListBackends.java b/opends/src/server/org/opends/server/tools/ListBackends.java
index 84f3b3f..a274076 100644
--- a/opends/src/server/org/opends/server/tools/ListBackends.java
+++ b/opends/src/server/org/opends/server/tools/ListBackends.java
@@ -336,6 +336,7 @@
// backend ID argument was present, then list the base DNs for that backend.
// If the base DN argument was present, then list the backend for that base
// DN. If no arguments were provided, then list all backends and base DNs.
+ boolean invalidDn = false;
if (baseDN.isPresent())
{
// Create a map from the base DNs of the backends to the corresponding
@@ -391,6 +392,7 @@
message = INFO_LISTBACKENDS_NO_BACKEND_FOR_DN.get(
dn.toString());
out.println(message);
+ invalidDn = true;
break;
}
else
@@ -505,7 +507,7 @@
// If we've gotten here, then everything completed successfully.
- return 0;
+ return invalidDn ? 1 : 0 ;
}
diff --git a/opends/tests/unit-tests-testng/src/server/org/opends/server/tools/ListBackendsTestCase.java b/opends/tests/unit-tests-testng/src/server/org/opends/server/tools/ListBackendsTestCase.java
index fa66790..bd7dbe6 100644
--- a/opends/tests/unit-tests-testng/src/server/org/opends/server/tools/ListBackendsTestCase.java
+++ b/opends/tests/unit-tests-testng/src/server/org/opends/server/tools/ListBackendsTestCase.java
@@ -357,7 +357,7 @@
"--baseDN", "ou=nonexistent"
};
- assertEquals(ListBackends.listBackends(args, false, null, null), 0);
+ assertEquals(ListBackends.listBackends(args, false, null, null), 1);
}
--
Gitblit v1.10.0