From: David Mulder Date: Fri, 28 Apr 2023 13:37:31 +0000 (-0600) Subject: gp: get_gpo() should re-raise the Exception, not return X-Git-Tag: talloc-2.4.1~724 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1dbdeaa8d7fcfa4b620bbd24e457ee7f2e6c132d;p=thirdparty%2Fsamba.git gp: get_gpo() should re-raise the Exception, not return If we return from this failure, then `new_gpo` is set to `None` and we will fail in some obscure way within a CSE later (since we append `None` to the GPO list). Instead, re-raise the Exception so we see that an error happened when fetching the GPO. Signed-off-by: David Mulder Reviewed-by: Andrew Bartlett --- diff --git a/python/samba/gp/gpclass.py b/python/samba/gp/gpclass.py index 4992f17eeac..6083a0f8029 100644 --- a/python/samba/gp/gpclass.py +++ b/python/samba/gp/gpclass.py @@ -618,7 +618,7 @@ def get_gpo(samdb, gpo_dn): controls=['sd_flags:1:%d' % sd_flags]) except Exception: log.error('Failed to fetch gpo object with nTSecurityDescriptor') - return + raise if res.count != 1: raise ldb.LdbError(ldb.ERR_NO_SUCH_OBJECT, 'get_gpo: search failed')