summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorDavid Mulder <dmulder@samba.org>2023-04-28 07:37:31 -0600
committerAndrew Bartlett <abartlet@samba.org>2023-05-09 01:59:32 +0000
commit1dbdeaa8d7fcfa4b620bbd24e457ee7f2e6c132d (patch)
treef2358f20fbf62c2583193ce7348e3bd130e0dcdb /python
parent9755206f6dde7ee4f9852bbd81cb79f4457faf86 (diff)
downloadsamba-1dbdeaa8d7fcfa4b620bbd24e457ee7f2e6c132d.tar.gz
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 <dmulder@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'python')
-rw-r--r--python/samba/gp/gpclass.py2
1 files changed, 1 insertions, 1 deletions
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')