summaryrefslogtreecommitdiff
path: root/source4/scripting
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2009-08-14 08:46:13 +1000
committerAndrew Bartlett <abartlet@samba.org>2009-08-17 09:50:59 +1000
commit052da4e4d77ceb0307ad2477f2bc4a17334d6565 (patch)
treeddf854cfe8f1c74f17e335301ad8664bc8a996d9 /source4/scripting
parent410114e41c713ccba2ac7d46e3f5acfddd986669 (diff)
downloadsamba-052da4e4d77ceb0307ad2477f2bc4a17334d6565.tar.gz
samba-052da4e4d77ceb0307ad2477f2bc4a17334d6565.tar.bz2
samba-052da4e4d77ceb0307ad2477f2bc4a17334d6565.zip
s4:python Allow 'no such object' on the delete of the DN
This fixes the recursive delete in erase_partitions() For reasons I cannot understand, it is possible to get 'no such object' trying to delete a DN I just search for without error. Oh well... Andrew Bartlett
Diffstat (limited to 'source4/scripting')
-rw-r--r--source4/scripting/python/samba/__init__.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/source4/scripting/python/samba/__init__.py b/source4/scripting/python/samba/__init__.py
index 5e4fa7223f..097d96a3f4 100644
--- a/source4/scripting/python/samba/__init__.py
+++ b/source4/scripting/python/samba/__init__.py
@@ -158,7 +158,11 @@ class Ldb(ldb.Ldb):
for msg in res:
erase_recursive(self, msg.dn)
- self.delete(dn)
+ try:
+ self.delete(dn)
+ except ldb.LdbError, (ldb.ERR_NO_SUCH_OBJECT, _):
+ # Ignore no such object errors
+ pass
res = self.search("", ldb.SCOPE_BASE, "(objectClass=*)",
["namingContexts"])