summaryrefslogtreecommitdiffstats
path: root/ipaserver/install/replication.py
diff options
context:
space:
mode:
authorPetr Vobornik <pvoborni@redhat.com>2015-06-15 19:14:37 +0200
committerPetr Vobornik <pvoborni@redhat.com>2015-06-29 17:09:54 +0200
commitdcb6916a3b0601e33b08e12aeb25357efed6812b (patch)
tree14ef9ba56a9a53af407dac33608a26096918cc05 /ipaserver/install/replication.py
parentf9cbdd4915d13cd6e20fe7631d3c95c1352860f9 (diff)
downloadfreeipa-dcb6916a3b0601e33b08e12aeb25357efed6812b.tar.gz
freeipa-dcb6916a3b0601e33b08e12aeb25357efed6812b.tar.xz
freeipa-dcb6916a3b0601e33b08e12aeb25357efed6812b.zip
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 Reviewed-By: David Kupka <dkupka@redhat.com>
Diffstat (limited to 'ipaserver/install/replication.py')
-rw-r--r--ipaserver/install/replication.py12
1 files changed, 3 insertions, 9 deletions
diff --git a/ipaserver/install/replication.py b/ipaserver/install/replication.py
index b367d7db8..9333f6714 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: