From: Stefan Metzmacher Date: Thu, 10 Feb 2022 15:57:01 +0000 (+0100) Subject: python/join: improve logging of join_replicate() X-Git-Tag: tevent-0.12.0~207 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=36ccb98aba815dc96263e2e419f8411e938e08d3;p=thirdparty%2Fsamba.git python/join: improve logging of join_replicate() It's useful to have timestamps to see the time used for replication and committing. We also warn the user that the committing stage may take some time. Signed-off-by: Stefan Metzmacher Reviewed-by: Andrew Bartlett --- diff --git a/python/samba/join.py b/python/samba/join.py index 4399367c817..91ed6da1147 100644 --- a/python/samba/join.py +++ b/python/samba/join.py @@ -936,7 +936,7 @@ class DCJoinContext(object): def join_replicate(ctx): """Replicate the SAM.""" - print("Starting replication") + ctx.logger.info("Starting replication") ctx.local_samdb.transaction_start() try: source_dsa_invocation_id = misc.GUID(ctx.samdb.get_invocation_id()) @@ -1016,12 +1016,13 @@ class DCJoinContext(object): ctx.source_dsa_invocation_id = source_dsa_invocation_id ctx.destination_dsa_guid = destination_dsa_guid - print("Committing SAM database") + ctx.logger.info("Committing SAM database - this may take some time") except: ctx.local_samdb.transaction_cancel() raise else: ctx.local_samdb.transaction_commit() + ctx.logger.info("Committed SAM database") # A large replication may have caused our LDB connection to the # remote DC to timeout, so check the connection is still alive