diff options
author | Rob Crittenden <rcritten@redhat.com> | 2009-02-05 13:12:11 -0500 |
---|---|---|
committer | Rob Crittenden <rcritten@redhat.com> | 2009-02-06 15:25:34 -0500 |
commit | 412104e34c0f85f32a4991bed0393b22e7cdf345 (patch) | |
tree | f7077c00161b4b7985f3d43a2ecac7231cb0f55d /ipaserver | |
parent | 31866db9221970ae30d3296cebd2ee92099a7d13 (diff) | |
download | freeipa.git-412104e34c0f85f32a4991bed0393b22e7cdf345.tar.gz freeipa.git-412104e34c0f85f32a4991bed0393b22e7cdf345.tar.xz freeipa.git-412104e34c0f85f32a4991bed0393b22e7cdf345.zip |
Remove more unused files and functions, replace ipaerror with new error classes
Diffstat (limited to 'ipaserver')
-rw-r--r-- | ipaserver/install/krbinstance.py | 4 | ||||
-rw-r--r-- | ipaserver/install/ldapupdate.py | 15 | ||||
-rw-r--r-- | ipaserver/install/replication.py | 10 | ||||
-rw-r--r-- | ipaserver/ipaldap.py | 6 |
4 files changed, 18 insertions, 17 deletions
diff --git a/ipaserver/install/krbinstance.py b/ipaserver/install/krbinstance.py index fb99604c..4efa4e9b 100644 --- a/ipaserver/install/krbinstance.py +++ b/ipaserver/install/krbinstance.py @@ -34,8 +34,8 @@ import service import installutils from ipa import sysrestore from ipa import ipautil -from ipa import ipaerror from ipalib import util +from ipalib import errors2 from ipaserver import ipaldap @@ -322,7 +322,7 @@ class KrbInstance(service.Service): def __write_stash_from_ds(self): try: entry = self.conn.getEntry("cn=%s, cn=kerberos, %s" % (self.realm, self.suffix), ldap.SCOPE_SUBTREE) - except ipaerror.exception_for(ipaerror.LDAP_NOT_FOUND), e: + except errors2.NotFound: logging.critical("Could not find master key in DS") raise e diff --git a/ipaserver/install/ldapupdate.py b/ipaserver/install/ldapupdate.py index b9efe84a..3690b75b 100644 --- a/ipaserver/install/ldapupdate.py +++ b/ipaserver/install/ldapupdate.py @@ -27,8 +27,9 @@ UPDATES_DIR="/usr/share/ipa/updates/" import sys from ipaserver.install import installutils from ipaserver import ipaldap -from ipa import entity, ipaerror, ipautil +from ipa import entity, ipautil from ipalib import util +from ipalib import errors, errors2 import ldap import logging import krbV @@ -326,10 +327,10 @@ class LDAPUpdate: while True: try: entry = self.conn.getEntry(dn, ldap.SCOPE_BASE, "(objectclass=*)", attrlist) - except ldap.NO_SUCH_OBJECT: + except errors2.NotFound: logging.error("Task not found: %s", dn) return - except ipaerror.exception_for(ipaerror.LDAP_DATABASE_ERROR), e: + except errors.DatabaseError, e: logging.error("Task lookup failure %s: %s", e, self.__detail_error(e.detail)) return @@ -496,11 +497,11 @@ class LDAPUpdate: entry = self.__entry_to_entity(e[0]) found = True logging.info("Updating existing entry: %s", entry.dn) - except ldap.NO_SUCH_OBJECT: + except errors2.NotFound: # Doesn't exist, start with the default entry entry = new_entry logging.info("New entry: %s", entry.dn) - except ipaerror.exception_for(ipaerror.LDAP_DATABASE_ERROR): + except errors.DatabaseError: # Doesn't exist, start with the default entry entry = new_entry logging.info("New entry, using default value: %s", entry.dn) @@ -536,10 +537,10 @@ class LDAPUpdate: if self.live_run and updated: self.conn.updateEntry(entry.dn, entry.origDataDict(), entry.toDict()) logging.info("Done") - except ipaerror.exception_for(ipaerror.LDAP_EMPTY_MODLIST), e: + except errors.EmptyModlist: logging.info("Entry already up-to-date") updated = False - except ipaerror.exception_for(ipaerror.LDAP_DATABASE_ERROR), e: + except errors.DatabaseError, e: logging.error("Update failed: %s: %s", e, self.__detail_error(e.detail)) updated = False diff --git a/ipaserver/install/replication.py b/ipaserver/install/replication.py index 33ed9c8a..12db0eb0 100644 --- a/ipaserver/install/replication.py +++ b/ipaserver/install/replication.py @@ -23,8 +23,8 @@ import ldap from ipaserver.install import dsinstance from ipaserver import ipaldap from ldap import modlist -from ipa import ipaerror from ipalib import util +from ipalib import errors2 DIRMAN_CN = "cn=directory manager" CACERT="/usr/share/ipa/html/ca.crt" @@ -148,7 +148,7 @@ class ReplicationManager: conn.getEntry(dn, ldap.SCOPE_BASE) # replication is already configured return - except ipaerror.exception_for(ipaerror.LDAP_NOT_FOUND): + except errors2.NotFound: pass replica_type = self.get_replica_type() @@ -220,7 +220,7 @@ class ReplicationManager: try: entry = self.conn.getEntry("cn=mapping tree,cn=config", ldap.SCOPE_ONELEVEL, "(cn=\"%s\")" % (self.suffix)) - except ipaerror.exception_for(ipaerror.LDAP_NOT_FOUND), e: + except errors2.NotFound, e: logging.debug("failed to find mappting tree entry for %s" % self.suffix) raise e @@ -256,7 +256,7 @@ class ReplicationManager: conn.getEntry(pass_dn, ldap.SCOPE_BASE) print "Windows PassSync entry exists, not resetting password" return - except ipaerror.exception_for(ipaerror.LDAP_NOT_FOUND): + except errors2.NotFound: pass # The user doesn't exist, add it @@ -315,7 +315,7 @@ class ReplicationManager: try: a.getEntry(dn, ldap.SCOPE_BASE) return - except ipaerror.exception_for(ipaerror.LDAP_NOT_FOUND): + except errors2.NotFound: pass iswinsync = kargs.get("winsync", False) diff --git a/ipaserver/ipaldap.py b/ipaserver/ipaldap.py index e7177b3e..a490c340 100644 --- a/ipaserver/ipaldap.py +++ b/ipaserver/ipaldap.py @@ -320,7 +320,7 @@ class IPAdmin(SimpleLDAPObject): # Too many results returned by search raise e except ldap.LDAPError, e: - raise e + raise errors.DatabaseError, e if not obj: raise errors2.NotFound(msg=notfound(args)) @@ -357,7 +357,7 @@ class IPAdmin(SimpleLDAPObject): ldap.TIMELIMIT_EXCEEDED), e: partial = 1 except ldap.LDAPError, e: - raise e + raise errors.DatabaseError, e if not entries: raise errors2.NotFound(msg=notfound(args)) @@ -514,7 +514,7 @@ class IPAdmin(SimpleLDAPObject): self.set_option(ldap.OPT_SERVER_CONTROLS, sctrl) self.passwd_s(dn, oldpass, newpass) except ldap.LDAPError, e: - raise e + raise errors.DatabaseError, e return True def __wrapmethods(self): |