This is an automated email from the git hooks/post-receive script.
mreynolds pushed a commit to branch 389-ds-base-1.4.1
in repository 389-ds-base.
The following commit(s) were added to refs/heads/389-ds-base-1.4.1 by this push:
new 876ce73 Issue 50753 - Dumping the changelog to a file doesn't work
876ce73 is described below
commit 876ce73739f2b6c62786087f7fafa1990770f0f4
Author: Simon Pichugin <spichugi(a)redhat.com>
AuthorDate: Tue Dec 3 23:27:51 2019 +0100
Issue 50753 - Dumping the changelog to a file doesn't work
Description: Pass the logging object to the code branch where
-i CHANGELOG_FILE is not specified, so -o OUTPUT_FILE works
correctly in that case too.
https://pagure.io/389-ds-base/issue/50753
Reviewed by: mreynolds (Thanks!)
---
src/lib389/lib389/cli_conf/replication.py | 3 ++-
src/lib389/lib389/replica.py | 11 +++++++----
2 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/src/lib389/lib389/cli_conf/replication.py
b/src/lib389/lib389/cli_conf/replication.py
index 58bbd13..47f530a 100644
--- a/src/lib389/lib389/cli_conf/replication.py
+++ b/src/lib389/lib389/cli_conf/replication.py
@@ -1000,7 +1000,8 @@ def dump_cl(inst, basedn, log, args):
if not args.changelog_ldif:
replicas.process_and_dump_changelog(replica_roots=args.replica_roots,
csn_only=args.csn_only,
- preserve_ldif_done=args.preserve_ldif_done)
+ preserve_ldif_done=args.preserve_ldif_done,
+ log=log)
else:
try:
assert os.path.exists(args.changelog_ldif)
diff --git a/src/lib389/lib389/replica.py b/src/lib389/lib389/replica.py
index 9b84d8f..9ba97ff 100644
--- a/src/lib389/lib389/replica.py
+++ b/src/lib389/lib389/replica.py
@@ -1648,7 +1648,7 @@ class Replicas(DSLdapObjects):
replica._populate_suffix()
return replica
- def process_and_dump_changelog(self, replica_roots=[], csn_only=False,
preserve_ldif_done=False):
+ def process_and_dump_changelog(self, replica_roots=[], csn_only=False,
preserve_ldif_done=False, log=None):
"""Dump and decode Directory Server replication change log
:param replica_roots: Replica suffixes that need to be processed
@@ -1657,6 +1657,9 @@ class Replicas(DSLdapObjects):
:type csn_only: bool
"""
+ if log is None:
+ log = self._log
+
repl_roots = []
try:
cl = Changelog5(self._instance)
@@ -1677,7 +1680,7 @@ class Replicas(DSLdapObjects):
got_ldif = False
current_time = time.time()
replica = self.get(repl_root)
- self._log.info(f"# Replica Root: {repl_root}")
+ log.info(f"# Replica Root: {repl_root}")
replica.replace("nsDS5Task", 'CL2LDIF')
# Decode the dumped changelog
@@ -1687,7 +1690,7 @@ class Replicas(DSLdapObjects):
if os.path.getmtime(file_path) < current_time:
continue
got_ldif = True
- cl_ldif = ChangelogLDIF(file_path, self._log)
+ cl_ldif = ChangelogLDIF(file_path, log)
if csn_only:
cl_ldif.grep_csn()
@@ -1700,7 +1703,7 @@ class Replicas(DSLdapObjects):
os.remove(file_path)
if not got_ldif:
- self._log.info("LDIF file: Not found")
+ log.info("LDIF file: Not found")
class BootstrapReplicationManager(DSLdapObject):
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.