From 465b879902dcf06940730ec41542fbdf7bd8dc08 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 2 Jul 2009 14:52:25 +1000 Subject: Changed ldb.ERR_NO_SUCH_OBJECT to LDB_ERR_NO_SUCH_OBJECT. The LDB_ERR_NO_SUCH_OBJECT varient is not a defined variable. This should improve error handling in our python code on some systems. Unfortunately it still doesn't work on mine. I need to trap Jelmer somewhere where he can't escape some day and force him to divulge the deep druid secrets of python exception handling .... --- source4/scripting/python/samba/__init__.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/source4/scripting/python/samba/__init__.py b/source4/scripting/python/samba/__init__.py index f93b0eda60..60a7919136 100644 --- a/source4/scripting/python/samba/__init__.py +++ b/source4/scripting/python/samba/__init__.py @@ -125,7 +125,7 @@ class Ldb(ldb.Ldb): "@OPTIONS", "@PARTITION", "@KLUDGEACL"]: try: self.delete(attr) - except ldb.LdbError, (LDB_ERR_NO_SUCH_OBJECT, _): + except ldb.LdbError, (ldb.ERR_NO_SUCH_OBJECT, _): # Ignore missing dn errors pass @@ -136,7 +136,7 @@ class Ldb(ldb.Ldb): ["distinguishedName"]): try: self.delete(msg.dn) - except ldb.LdbError, (LDB_ERR_NO_SUCH_OBJECT, _): + except ldb.LdbError, (ldb.ERR_NO_SUCH_OBJECT, _): # Ignore no such object errors pass @@ -159,7 +159,7 @@ class Ldb(ldb.Ldb): # and the rest try: res2 = self.search(basedn, ldb.SCOPE_SUBTREE, "(|(objectclass=*)(distinguishedName=*))", ["distinguishedName"]) - except ldb.LdbError, (LDB_ERR_NO_SUCH_OBJECT, _): + except ldb.LdbError, (ldb.ERR_NO_SUCH_OBJECT, _): # Ignore missing dn errors return @@ -169,10 +169,10 @@ class Ldb(ldb.Ldb): try: self.delete(msg.dn) # Ignore no such object errors - except ldb.LdbError, (LDB_ERR_NO_SUCH_OBJECT, _): + except ldb.LdbError, (ldb.ERR_NO_SUCH_OBJECT, _): pass # Ignore not allowed on non leaf errors - except ldb.LdbError, (LDB_ERR_NOT_ALLOWED_ON_NON_LEAF, _): + except ldb.LdbError, (ldb.ERR_NOT_ALLOWED_ON_NON_LEAF, _): pass def load_ldif_file_add(self, ldif_path): -- cgit