Blame SOURCES/0001-Revert-4866-cl-trimming-not-applicable-in-1.4.3.patch

0a5078
From 36da9be6b82c96a656fa6dd1f99e5a7c41c7652a Mon Sep 17 00:00:00 2001
0a5078
From: Thierry Bordaz <tbordaz@redhat.com>
0a5078
Date: Mon, 23 May 2022 16:53:41 +0200
0a5078
Subject: [PATCH] Revert 4866 - cl trimming not applicable in 1.4.3
0a5078
0a5078
---
0a5078
 .../suites/healthcheck/health_repl_test.py      |  2 +-
0a5078
 .../tests/suites/replication/acceptance_test.py | 17 +----------------
0a5078
 src/lib389/lib389/replica.py                    | 13 -------------
0a5078
 3 files changed, 2 insertions(+), 30 deletions(-)
0a5078
0a5078
diff --git a/dirsrvtests/tests/suites/healthcheck/health_repl_test.py b/dirsrvtests/tests/suites/healthcheck/health_repl_test.py
0a5078
index 9e1af2ff8..238d25290 100644
0a5078
--- a/dirsrvtests/tests/suites/healthcheck/health_repl_test.py
0a5078
+++ b/dirsrvtests/tests/suites/healthcheck/health_repl_test.py
0a5078
@@ -74,7 +74,7 @@ def set_changelog_trimming(instance):
0a5078
     inst_changelog = Changelog5(instance)
0a5078
 
0a5078
     log.info('Set nsslapd-changelogmaxage to 30d')
0a5078
-    inst_changelog.set_max_age('30d')
0a5078
+    inst_changelog.add('nsslapd-changelogmaxage', '30')
0a5078
 
0a5078
 
0a5078
 @pytest.mark.ds50873
0a5078
diff --git a/dirsrvtests/tests/suites/replication/acceptance_test.py b/dirsrvtests/tests/suites/replication/acceptance_test.py
0a5078
index 8b96df7a4..a5f0c4c6b 100644
0a5078
--- a/dirsrvtests/tests/suites/replication/acceptance_test.py
0a5078
+++ b/dirsrvtests/tests/suites/replication/acceptance_test.py
0a5078
@@ -15,7 +15,7 @@ from lib389.topologies import topology_m4 as topo_m4
0a5078
 from lib389.topologies import topology_m2 as topo_m2
0a5078
 from . import get_repl_entries
0a5078
 from lib389.idm.user import UserAccount
0a5078
-from lib389.replica import ReplicationManager, Changelog
0a5078
+from lib389.replica import ReplicationManager
0a5078
 from lib389._constants import *
0a5078
 
0a5078
 pytestmark = pytest.mark.tier0
0a5078
@@ -645,21 +645,6 @@ def test_csngen_task(topo_m2):
0a5078
     assert m1.searchErrorsLog("_csngen_gen_tester_main")
0a5078
 
0a5078
 
0a5078
-def test_default_cl_trimming_enabled(topo_m2):
0a5078
-    """Check that changelog trimming was enabled by default
0a5078
-
0a5078
-    :id: c37b9a28-f961-4867-b8a1-e81edd7f9bf3
0a5078
-    :setup: Supplier Instance
0a5078
-    :steps:
0a5078
-        1. Check changelog has trimming set up by default
0a5078
-    :expectedresults:
0a5078
-        1. Success
0a5078
-    """
0a5078
-
0a5078
-    # Set up changelog trimming by default
0a5078
-    cl = Changelog(topo_m2.ms["supplier1"], DEFAULT_SUFFIX)
0a5078
-    assert cl.get_attr_val_utf8("nsslapd-changelogmaxage") == "7d"
0a5078
-
0a5078
 
0a5078
 if __name__ == '__main__':
0a5078
     # Run isolated
0a5078
diff --git a/src/lib389/lib389/replica.py b/src/lib389/lib389/replica.py
0a5078
index c7328605b..90905dbf1 100644
0a5078
--- a/src/lib389/lib389/replica.py
0a5078
+++ b/src/lib389/lib389/replica.py
0a5078
@@ -1667,19 +1667,6 @@ class Replicas(DSLdapObjects):
0a5078
         self._childobject = Replica
0a5078
         self._basedn = DN_MAPPING_TREE
0a5078
 
0a5078
-    def create(self, rdn=None, properties=None):
0a5078
-        replica = super(Replicas, self).create(rdn, properties)
0a5078
-
0a5078
-        # Set up changelog trimming by default
0a5078
-        if properties is not None:
0a5078
-            for attr, val in properties.items():
0a5078
-                if attr.lower() == 'nsds5replicaroot':
0a5078
-                    cl = Changelog(self._instance, val[0])
0a5078
-                    cl.set_max_age("7d")
0a5078
-                    break
0a5078
-
0a5078
-        return replica
0a5078
-
0a5078
     def get(self, selector=[], dn=None):
0a5078
         """Get a child entry (DSLdapObject, Replica, etc.) with dn or selector
0a5078
         using a base DN and objectClasses of our object (DSLdapObjects, Replicas, etc.)
0a5078
-- 
0a5078
2.31.1
0a5078