https://fedorahosted.org/freeipa/ticket/1482

The nsDS5ReplicaUpdateSchedule parameter is omitted what results in
replication being run all the time. The parameter is still used for
forcing replica update but after that action it is always deleted.

--
Regards,

Ondrej Hamada
FreeIPA team
jabber: oh...@jabbim.cz
IRC: ohamada

From f0c0cd98c30c8557a6b8168cab7b5f50e31e9c9a Mon Sep 17 00:00:00 2001
From: Ondrej Hamada <oham...@redhat.com>
Date: Mon, 23 Jan 2012 17:28:37 +0100
Subject: [PATCH] Leave nsds5replicaupdateschedule parameter unset

The nsDS5ReplicaUpdateSchedule parameter is omited what results in
replication being run all the time. The parameter is still used for
forcing replica update but after that action it is always deleted.

https://fedorahosted.org/freeipa/ticket/1482
---
 ipaserver/install/replication.py |   19 ++++++++-----------
 1 files changed, 8 insertions(+), 11 deletions(-)

diff --git a/ipaserver/install/replication.py b/ipaserver/install/replication.py
index 3ac99e6bd75f2990be346c14fce424927c6550fa..052f183468e0f65e410174ba3529c53d69fcdbeb 100644
--- a/ipaserver/install/replication.py
+++ b/ipaserver/install/replication.py
@@ -460,7 +460,6 @@ class ReplicationManager(object):
         entry.setValues('nsds5replicatimeout', str(TIMEOUT))
         entry.setValues('nsds5replicaroot', self.suffix)
         if master is None:
-            entry.setValues('nsds5replicaupdateschedule', '0000-2359 0123456')
             entry.setValues('nsDS5ReplicatedAttributeList',
                             '(objectclass=*) $ EXCLUDE %s' % " ".join(excludes))
         entry.setValues('description', "me to %s" % b_hostname)
@@ -853,22 +852,20 @@ class ReplicationManager(object):
 
         dn = entry[0].dn
         schedule = entry[0].nsds5replicaupdateschedule
-        if schedule is None:
-            schedule = '0000-2359 0123456'
 
         # 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'
-        root_logger.info("Changing agreement %s schedule to %s to force synch" %
+        # now by setting the schedule to something and quickly removing it.
+        if schedule is not None:
+            if newschedule == schedule:
+                newschedule = '2358-2359 1'
+        root_logger.info("Setting agreement %s schedule to %s to force synch" %
                      (dn, newschedule))
         mod = [(ldap.MOD_REPLACE, 'nsDS5ReplicaUpdateSchedule', [ newschedule ])]
         conn.modify_s(dn, mod)
         time.sleep(1)
-        root_logger.info("Changing agreement %s to restore original schedule %s" %
-                     (dn, schedule))
-        mod = [(ldap.MOD_REPLACE, 'nsDS5ReplicaUpdateSchedule', [ schedule ])]
+        root_logger.info("Deleting schedule %s from agreement %s" %
+                     (newschedule, dn))
+        mod = [(ldap.MOD_DELETE, 'nsDS5ReplicaUpdateSchedule', None)]
         conn.modify_s(dn, mod)
 
     def get_agreement_type(self, hostname):
-- 
1.7.6.5

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

Reply via email to