in other words limit usage of `agreement_dn` method only for manipulation and search of agreements which are not managed by topology plugin.
For other cases is safer to search for the agreement. https://fedorahosted.org/freeipa/ticket/5066 -- Petr Vobornik
From 8c711919c5201e73a228ddb3a1d5b45892c4d971 Mon Sep 17 00:00:00 2001 From: Petr Vobornik <pvobo...@redhat.com> Date: Mon, 15 Jun 2015 19:14:37 +0200 Subject: [PATCH] fix force-sync, re-initialize of replica and a check for replication agreement existence in other words limit usage of `agreement_dn` method only for manipulation and search of agreements which are not managed by topology plugin. For other cases is safer to search for the agreement. https://fedorahosted.org/freeipa/ticket/5066 --- ipaserver/install/replication.py | 12 +++--------- ipaserver/install/server/replicainstall.py | 8 +------- 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/ipaserver/install/replication.py b/ipaserver/install/replication.py index 6a8daadce44c59ea7e3960b5f3387df4d04c85fd..efdb7dfdfed1800c2a7f9720e1ce4f5e9ccf42b7 100644 --- a/ipaserver/install/replication.py +++ b/ipaserver/install/replication.py @@ -1167,10 +1167,8 @@ class ReplicationManager(object): conn.modify_s(dn, mod) def get_agreement_type(self, hostname): - cn, dn = self.agreement_dn(hostname) - - entry = self.conn.get_entry(dn) + entry = self.get_replication_agreement(hostname) objectclass = entry.get("objectclass") for o in objectclass: @@ -1578,9 +1576,7 @@ class ReplicationManager(object): """ Disable the replication agreement to hostname. """ - cn, dn = self.agreement_dn(hostname) - - entry = self.conn.get_entry(dn) + entry = self.get_replication_agreement(hostname) entry['nsds5ReplicaEnabled'] = 'off' try: @@ -1594,9 +1590,7 @@ class ReplicationManager(object): Note: for replication to work it needs to be enabled both ways. """ - cn, dn = self.agreement_dn(hostname) - - entry = self.conn.get_entry(dn) + entry = self.get_replication_agreement(hostname) entry['nsds5ReplicaEnabled'] = 'on' try: diff --git a/ipaserver/install/server/replicainstall.py b/ipaserver/install/server/replicainstall.py index 34580ce198b40f922ea984c1eea2dcd0c3aebb08..ae1d325c20a3cf3ff9d27468d4a9f3c021df17bc 100644 --- a/ipaserver/install/server/replicainstall.py +++ b/ipaserver/install/server/replicainstall.py @@ -407,13 +407,7 @@ def install_check(installer): config.dirman_password) # Check that we don't already have a replication agreement - try: - (agreement_cn, agreement_dn) = replman.agreement_dn( - config.host_name) - entry = conn.get_entry(agreement_dn, ['*']) - except errors.NotFound: - pass - else: + if replman.get_replication_agreement(config.host_name): root_logger.info('Error: A replication agreement for this ' 'host already exists.') print('A replication agreement for this host already exists. ' -- 2.1.0
-- Manage your subscription for the Freeipa-devel mailing list: https://www.redhat.com/mailman/listinfo/freeipa-devel Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code