The search had an incorrect scope and therefore it didn't find any RUV.

This issue prevented removing of replica.

https://fedorahosted.org/freeipa/ticket/3876
--
Petr Vobornik
From f45007f57cebf7508022d0861bc3adda260c8f77 Mon Sep 17 00:00:00 2001
From: Petr Vobornik <pvobo...@redhat.com>
Date: Tue, 3 Sep 2013 11:01:48 +0200
Subject: [PATCH] Fix RUV search scope in ipa-replica-manage

The search had an incorrect scope and therefore it didn't find any RUV.

This issue prevented removing of replica.

https://fedorahosted.org/freeipa/ticket/3876
---
 install/tools/ipa-replica-manage                     |  2 +-
 ipatests/test_integration/test_simple_replication.py | 10 ++++++++++
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/install/tools/ipa-replica-manage b/install/tools/ipa-replica-manage
index e2bd38e9b824f210871e2881461945bc08a2fe01..45b915c664c6776dc019b180d049eb985cf21abd 100755
--- a/install/tools/ipa-replica-manage
+++ b/install/tools/ipa-replica-manage
@@ -348,7 +348,7 @@ def get_ruv(realm, host, dirman_passwd, nolookup=False):
     search_filter = '(&(nsuniqueid=ffffffff-ffffffff-ffffffff-ffffffff)(objectclass=nstombstone))'
     try:
         entries = thisrepl.conn.get_entries(
-            api.env.basedn, thisrepl.conn.SCOPE_ONELEVEL, search_filter,
+            api.env.basedn, thisrepl.conn.SCOPE_SUBTREE, search_filter,
             ['nsds50ruv'])
     except errors.NotFound:
         print "No RUV records found."
diff --git a/ipatests/test_integration/test_simple_replication.py b/ipatests/test_integration/test_simple_replication.py
index 2d8f9fcfe53e33b94085d5cc9485461c58a37f39..998b1196a24ef52b88ab4a6248cdc2d1f808677d 100644
--- a/ipatests/test_integration/test_simple_replication.py
+++ b/ipatests/test_integration/test_simple_replication.py
@@ -59,3 +59,13 @@ class TestSimpleReplication(IntegrationTest):
     def test_user_replication_to_master(self):
         """Test user replication replica -> master"""
         self.check_replication(self.replicas[0], self.master, 'testuser2')
+
+    def test_replica_removal(self):
+        """Test replica removal"""
+        result = self.master.run_command(['ipa-replica-manage', 'list'])
+        assert self.replicas[0].hostname in result.stdout_text
+        # has to be run with --force, there is no --unattended
+        self.master.run_command(['ipa-replica-manage', 'del',
+                                 self.replicas[0].hostname, '--force'])
+        result = self.master.run_command(['ipa-replica-manage', 'list'])
+        assert self.replicas[0].hostname not in result.stdout_text
-- 
1.8.3.1

_______________________________________________
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

Reply via email to