From d583675040393140f02d0050dc1bc5357e91fc4c Mon Sep 17 00:00:00 2001
From: jvergara <jvergara@localhost>
Date: Wed, 19 Sep 2007 15:55:37 +0000
Subject: [PATCH] Only display the warning message informing that there were errors reading the configuration of the servers in the ADS when the ADS already existed.

---
 opends/src/guitools/org/opends/guitools/replicationcli/ReplicationCliMain.java |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/opends/src/guitools/org/opends/guitools/replicationcli/ReplicationCliMain.java b/opends/src/guitools/org/opends/guitools/replicationcli/ReplicationCliMain.java
index c5139fb..4259fa9 100644
--- a/opends/src/guitools/org/opends/guitools/replicationcli/ReplicationCliMain.java
+++ b/opends/src/guitools/org/opends/guitools/replicationcli/ReplicationCliMain.java
@@ -2871,12 +2871,18 @@
 
     boolean adsAlreadyReplicated = false;
 
+    // Booleans used to know if the ADS existed already on the servers.
+    boolean ads1Existed = false;
+    boolean ads2Existed = false;
+
     printProgressMessage(formatter.getFormattedWithPoints(
         INFO_REPLICATION_ENABLE_UPDATING_ADS_CONTENTS.get()));
     try
     {
       if (adsCtx1.hasAdminData() && adsCtx2.hasAdminData())
       {
+        ads1Existed = true;
+        ads2Existed = true;
         Set<Map<ADSContext.ServerProperty, Object>> registry1 =
           adsCtx1.readServerRegistry();
         Set<Map<ADSContext.ServerProperty, Object>> registry2 =
@@ -2942,6 +2948,7 @@
       }
       else if (!adsCtx1.hasAdminData() && adsCtx2.hasAdminData())
       {
+        ads2Existed = true;
         adsCtx1.createAdministrationSuffix(null);
         if (!hasAdministrator(adsCtx2.getDirContext()))
         {
@@ -2956,6 +2963,7 @@
       }
       else if (adsCtx1.hasAdminData() && !adsCtx2.hasAdminData())
       {
+        ads1Existed = true;
         adsCtx2.createAdministrationSuffix(null);
         if (!hasAdministrator(adsCtx1.getDirContext()))
         {
@@ -3052,11 +3060,11 @@
     {
       // Inform the user of the potential errors that we found.
       LinkedHashSet<Message> messages = new LinkedHashSet<Message>();
-      if (cache1 != null)
+      if ((cache1 != null) && ads1Existed)
       {
         messages.addAll(getErrorMessages(cache1));
       }
-      if (cache2 != null)
+      if ((cache2 != null) && ads2Existed)
       {
         messages.addAll(getErrorMessages(cache2));
       }

--
Gitblit v1.10.0