summaryrefslogtreecommitdiffstats
path: root/ipaserver/install/replication.py
diff options
context:
space:
mode:
authorRob Crittenden <rcritten@redhat.com>2012-08-30 16:24:10 -0400
committerRob Crittenden <rcritten@redhat.com>2012-10-09 15:45:44 -0400
commit2ca7bb3134cc74daf9588b0a964a5572b49bc58a (patch)
treefb91de43e38f7dc6329e668356fb2942091698eb /ipaserver/install/replication.py
parentb3606e3d9237926eaf9d621b565d29317ca00a47 (diff)
downloadfreeipa-2ca7bb3134cc74daf9588b0a964a5572b49bc58a.tar.gz
freeipa-2ca7bb3134cc74daf9588b0a964a5572b49bc58a.tar.xz
freeipa-2ca7bb3134cc74daf9588b0a964a5572b49bc58a.zip
Fix CS replication management.
The master side should be on the local side, replica1, not the remote. This required reversing a few master variables. This impacts the naming of the replication agreements. When deleting an agreement pass in the DN of that agreement rather than trying to calculate what it is on-the-fly. We cannot be sure which side is the master/clone and since we search for it anyway to determine if the agreement exists it is more correct to use what we find. The force flag wasn't being passed into del_link so there was no way to force a deletion. https://fedorahosted.org/freeipa/ticket/2858
Diffstat (limited to 'ipaserver/install/replication.py')
-rw-r--r--ipaserver/install/replication.py22
1 files changed, 17 insertions, 5 deletions
diff --git a/ipaserver/install/replication.py b/ipaserver/install/replication.py
index 564097e76..260e7bba1 100644
--- a/ipaserver/install/replication.py
+++ b/ipaserver/install/replication.py
@@ -648,8 +648,20 @@ class ReplicationManager(object):
except ldap.NO_SUCH_OBJECT:
pass
- def delete_agreement(self, hostname):
- cn, dn = self.agreement_dn(hostname)
+ def delete_agreement(self, hostname, dn=None):
+ """
+ Delete a replication agreement.
+
+ @hostname: the hostname of the agreement to remove
+ @dn: optional dn of the agreement to remove
+
+ For IPA agreements we can easily calculate the DN of the agreement
+ to remove. Dogtag agreements are another matter, its agreement
+ names depend entirely on where it is created. In this case it is
+ better to pass the DN in directly.
+ """
+ if dn is None:
+ cn, dn = self.agreement_dn(hostname)
return self.conn.deleteEntry(dn)
def delete_referral(self, hostname):
@@ -808,11 +820,11 @@ class ReplicationManager(object):
self.setup_agreement(r_conn, self.conn.host, port=r_port,
repl_man_dn=self.repl_man_dn,
repl_man_passwd=self.repl_man_passwd,
- master=True)
+ master=False)
self.setup_agreement(self.conn, r_hostname, port=r_port,
repl_man_dn=self.repl_man_dn,
repl_man_passwd=self.repl_man_passwd,
- master=False)
+ master=True)
else:
self.setup_agreement(r_conn, self.conn.host, port=r_port,
repl_man_dn=self.repl_man_dn,
@@ -822,7 +834,7 @@ class ReplicationManager(object):
repl_man_passwd=self.repl_man_passwd)
#Finally start replication
- ret = self.start_replication(r_conn, master=True)
+ ret = self.start_replication(r_conn, master=False)
if ret != 0:
raise RuntimeError("Failed to start replication")