From ce3daba25518b18b60788e9676160f085996e491 Mon Sep 17 00:00:00 2001
From: Violette Roche-Montane <violette.roche-montane@forgerock.com>
Date: Thu, 28 Feb 2013 10:16:17 +0000
Subject: [PATCH] OPENDJ-771 rebuild-index tool should fail when "--clearDegradedState" and "--rebuildDegraded" options are specified on the same command line
---
opendj-sdk/opends/src/messages/messages/tools.properties | 6 +++---
opendj-sdk/opends/src/server/org/opends/server/tools/RebuildIndex.java | 16 +++++++++++++---
2 files changed, 16 insertions(+), 6 deletions(-)
diff --git a/opendj-sdk/opends/src/messages/messages/tools.properties b/opendj-sdk/opends/src/messages/messages/tools.properties
index 1b97b2d..ab8b62b 100644
--- a/opendj-sdk/opends/src/messages/messages/tools.properties
+++ b/opendj-sdk/opends/src/messages/messages/tools.properties
@@ -2589,9 +2589,9 @@
INFO_REBUILDINDEX_DESCRIPTION_REBUILD_DEGRADED_1720=Rebuild all degraded \
indexes, including any DN2ID, DN2URI, VLV and extensible indexes. Cannot be used \
with the "-i" option or the "--rebuildAll" option
-SEVERE_ERR_REBUILDINDEX_REBUILD_DEGRADED_ERROR_1721=Index "-i" option cannot be \
- specified with the "--rebuildDegraded" option
-SEVERE_ERR_REBUILDINDEX_REBUILD_ALL_DEGRADED_ERROR_1722=Option "--%s" \
+SEVERE_ERR_REBUILDINDEX_REBUILD_DEGRADED_ERROR_1721=Option "--rebuildDegraded" cannot be \
+ specified with the "--%s" option
+SEVERE_ERR_REBUILDINDEX_REBUILD_ALL_DEGRADED_ERROR_1722=Option "--rebuildAll" \
cannot be specified with the "--%s" option
SEVERE_ERR_CONFIGDS_CANNOT_UPDATE_DIGEST_MD5_FQDN_1733=An error occurred while \
attempting to update the FQDN for the DIGEST-MD5 SASL mechanism: %s
diff --git a/opendj-sdk/opends/src/server/org/opends/server/tools/RebuildIndex.java b/opendj-sdk/opends/src/server/org/opends/server/tools/RebuildIndex.java
index d378462..0b2af4b 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/tools/RebuildIndex.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/tools/RebuildIndex.java
@@ -286,7 +286,17 @@
if(rebuildDegraded.isPresent() && indexList.isPresent())
{
- Message msg = ERR_REBUILDINDEX_REBUILD_DEGRADED_ERROR.get();
+ Message msg = ERR_REBUILDINDEX_REBUILD_DEGRADED_ERROR.get(
+ "index");
+ err.println(wrapText(msg, MAX_LINE_WIDTH));
+ out.println(argParser.getUsage());
+ return 1;
+ }
+
+ if(rebuildDegraded.isPresent() && clearDegradedState.isPresent())
+ {
+ Message msg = ERR_REBUILDINDEX_REBUILD_DEGRADED_ERROR.get(
+ "clearDegradedState");
err.println(wrapText(msg, MAX_LINE_WIDTH));
out.println(argParser.getUsage());
return 1;
@@ -295,7 +305,7 @@
if(rebuildAll.isPresent() && rebuildDegraded.isPresent())
{
Message msg = ERR_REBUILDINDEX_REBUILD_ALL_DEGRADED_ERROR.get(
- "rebuildAll", "rebuildDegraded");
+ "rebuildDegraded");
err.println(wrapText(msg, MAX_LINE_WIDTH));
out.println(argParser.getUsage());
return 1;
@@ -304,7 +314,7 @@
if(rebuildAll.isPresent() && clearDegradedState.isPresent())
{
Message msg = ERR_REBUILDINDEX_REBUILD_ALL_DEGRADED_ERROR.get(
- "rebuildAll", "clearDegradedState");
+ "clearDegradedState");
err.println(wrapText(msg, MAX_LINE_WIDTH));
out.println(argParser.getUsage());
return 1;
--
Gitblit v1.10.0