diff options
author | Rob Crittenden <rcritten@redhat.com> | 2008-03-07 10:56:03 -0500 |
---|---|---|
committer | Rob Crittenden <rcritten@redhat.com> | 2008-03-07 10:56:03 -0500 |
commit | 092b1b694c33b28a5b33678b443611d244363c76 (patch) | |
tree | 61cde3cc340d5eb55c9dc0deebf6ba0ec265b240 /ipa-server/ipaserver/replication.py | |
parent | 03d7125eacb5c0fc15d416349f6ad48d22ef5acb (diff) | |
download | freeipa.git-092b1b694c33b28a5b33678b443611d244363c76.tar.gz freeipa.git-092b1b694c33b28a5b33678b443611d244363c76.tar.xz freeipa.git-092b1b694c33b28a5b33678b443611d244363c76.zip |
Add ability to initialize a replication agreement
Add ability to force a synch to occur
Clean up a lot of unused code in ipaldap.py. This lets us do a simple bind
without being root (it used to try to read dse.ldif)
436237
Diffstat (limited to 'ipa-server/ipaserver/replication.py')
-rw-r--r-- | ipa-server/ipaserver/replication.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/ipa-server/ipaserver/replication.py b/ipa-server/ipaserver/replication.py index 153780ec..b9e4e6cb 100644 --- a/ipa-server/ipaserver/replication.py +++ b/ipa-server/ipaserver/replication.py @@ -20,6 +20,7 @@ import time, logging import ipaldap, ldap, dsinstance +from ldap import modlist from ipa import ipaerror DIRMAN_CN = "cn=directory manager" @@ -320,3 +321,21 @@ class ReplicationManager: self.setup_agreement(self.conn, other_conn) return self.start_replication(other_conn) + + def initialize_replication(self, dn, conn): + mod = [(ldap.MOD_ADD, 'nsds5BeginReplicaRefresh', 'start')] + try: + conn.modify_s(dn, mod) + except ldap.ALREADY_EXISTS: + return + + def force_synch(self, dn, schedule, conn): + newschedule = '2358-2359 0' + + # On the remote chance of a match. We force a synch to happen right + # now by changing the schedule to something else and quickly changing + # it back. + if newschedule == schedule: + newschedule = '2358-2359 1' + mod = [(ldap.MOD_REPLACE, 'nsDS5ReplicaUpdateSchedule', [ newschedule ])] + conn.modify_s(dn, mod) |