diff options
author | Rob Crittenden <rcritten@redhat.com> | 2009-01-28 21:47:21 -0700 |
---|---|---|
committer | Rob Crittenden <rcritten@redhat.com> | 2009-02-03 15:29:04 -0500 |
commit | 5717c9d6689f15c46801f2d251e174fad4ce4748 (patch) | |
tree | 31e2a3378638bd63005a3d65d7fe74159860456c /ipaserver/ipaldap.py | |
parent | 48a278047db50f919a45ef82a57a6983804ed523 (diff) | |
download | freeipa.git-5717c9d6689f15c46801f2d251e174fad4ce4748.tar.gz freeipa.git-5717c9d6689f15c46801f2d251e174fad4ce4748.tar.xz freeipa.git-5717c9d6689f15c46801f2d251e174fad4ce4748.zip |
Applied Rob's errors patch
Diffstat (limited to 'ipaserver/ipaldap.py')
-rw-r--r-- | ipaserver/ipaldap.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/ipaserver/ipaldap.py b/ipaserver/ipaldap.py index 4a2e4e31..e7177b3e 100644 --- a/ipaserver/ipaldap.py +++ b/ipaserver/ipaldap.py @@ -32,7 +32,7 @@ import ldap.sasl from ldap.controls import LDAPControl,DecodeControlTuples,EncodeControlTuples from ldap.ldapobject import SimpleLDAPObject from ipaserver import ipautil -from ipalib import errors +from ipalib import errors, errors2 # Global variable to define SASL auth sasl_auth = ldap.sasl.sasl({},'GSSAPI') @@ -294,12 +294,12 @@ class IPAdmin(SimpleLDAPObject): res = self.search(*args) objtype, obj = self.result(res) except ldap.NO_SUCH_OBJECT, e: - raise errors.NotFound, notfound(args) + raise errors2.NotFound(msg=notfound(args)) except ldap.LDAPError, e: raise errors.DatabaseError, e if not obj: - raise errors.NotFound, notfound(args) + raise errors2.NotFound(msg=notfound(args)) elif isinstance(obj,Entry): return obj @@ -323,7 +323,7 @@ class IPAdmin(SimpleLDAPObject): raise e if not obj: - raise errors.NotFound, notfound(args) + raise errors2.NotFound(msg=notfound(args)) entries = [] for s in obj: @@ -360,7 +360,7 @@ class IPAdmin(SimpleLDAPObject): raise e if not entries: - raise errors.NotFound, notfound(args) + raise errors2.NotFound(msg=notfound(args)) if partial == 1: counter = -1 @@ -380,7 +380,7 @@ class IPAdmin(SimpleLDAPObject): self.set_option(ldap.OPT_SERVER_CONTROLS, sctrl) self.add_s(*args) except ldap.ALREADY_EXISTS, e: - raise errors.DuplicateEntry, "Entry already exists" + raise errors2.DuplicateEntry except ldap.LDAPError, e: raise errors.DatabaseError, e return True |