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

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