diff options
| author | Andrew Tridgell <tridge@samba.org> | 2009-07-02 14:52:25 +1000 | 
|---|---|---|
| committer | Andrew Tridgell <tridge@samba.org> | 2009-07-02 14:55:38 +1000 | 
| commit | 465b879902dcf06940730ec41542fbdf7bd8dc08 (patch) | |
| tree | a91be208bca7e47ff3a1c3ceb10cf4228c51e47a /source4/scripting/python | |
| parent | ae8515d31b55bbe47b45aa2892d5d98000f645c4 (diff) | |
| download | samba-465b879902dcf06940730ec41542fbdf7bd8dc08.tar.gz samba-465b879902dcf06940730ec41542fbdf7bd8dc08.tar.bz2 samba-465b879902dcf06940730ec41542fbdf7bd8dc08.zip | |
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 ....
Diffstat (limited to 'source4/scripting/python')
| -rw-r--r-- | source4/scripting/python/samba/__init__.py | 10 | 
1 files 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): | 
