From: David Mulder Date: Thu, 9 Feb 2023 17:34:24 +0000 (-0700) Subject: gp: Log ext failure with file and line number X-Git-Tag: talloc-2.4.1~1640 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ff98ddf0f9286db545419bb52947ebf5c021885f;p=thirdparty%2Fsamba.git gp: Log ext failure with file and line number Rather than dumping a traceback when there is a failure, simply log the file name, line number and the error message instead. This is much cleaner. Signed-off-by: David Mulder Reviewed-by: Andreas Schneider --- diff --git a/python/samba/gp/gpclass.py b/python/samba/gp/gpclass.py index 4737bfe0738..bec1ec5fecf 100644 --- a/python/samba/gp/gpclass.py +++ b/python/samba/gp/gpclass.py @@ -677,8 +677,10 @@ def apply_gp(lp, creds, store, gp_extensions, username, target, force=False): del_gpos, changed_gpos) except Exception as e: log.error('Failed to apply extension %s' % str(ext)) - log.error('Message was: %s: %s' % (type(e).__name__, str(e))) - log.debug(traceback.format_exc()) + _, _, tb = sys.exc_info() + filename, line_number, _, _ = traceback.extract_tb(tb)[-1] + log.error('%s:%d: %s: %s' % (filename, line_number, + type(e).__name__, str(e))) continue for gpo_obj in gpos: if not gpo_obj.file_sys_path: