summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Sutton <josephsutton@catalyst.net.nz>2021-05-24 16:40:55 +1200
committerKarolin Seeger <kseeger@samba.org>2021-07-12 12:55:43 +0000
commit79029224ee02ff9f240ab1a81a3372a193b0879d (patch)
tree788d1cf66b80508ab829f6f69ae09387e740f567
parentc1ac591c1976278aac7c26f91d87acdf37bdfb77 (diff)
downloadsamba-79029224ee02ff9f240ab1a81a3372a193b0879d.tar.gz
netcmd: Fix error-checking condition
This condition probably meant to check the argument of the most recently thrown exception, rather than the previous one again. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14669 Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> (cherry picked from commit e8c242bed19432d96e78dc345ab5f06422c5b104)
-rw-r--r--python/samba/netcmd/domain_backup.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/python/samba/netcmd/domain_backup.py b/python/samba/netcmd/domain_backup.py
index 9eae6d3c3cf..8d261fd4b97 100644
--- a/python/samba/netcmd/domain_backup.py
+++ b/python/samba/netcmd/domain_backup.py
@@ -602,11 +602,12 @@ class cmd_domain_backup_restore(cmd_fsmo_seize):
controls=["show_deleted:0",
"show_recycled:0"])
except LdbError as dup_e:
- if enum != ldb.ERR_NO_SUCH_OBJECT:
- raise e
+ (dup_enum, _) = dup_e.args
+ if dup_enum != ldb.ERR_NO_SUCH_OBJECT:
+ raise
if (len(dup_res) != 1):
- raise e
+ raise
objectguid = samdb.schema_format_value("objectGUID",
dup_res[0]["objectGUID"][0])