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