Replace deleteEntry with delete_entry

Part of the work for: https://fedorahosted.org/freeipa/ticket/2660
This commit is contained in:
Petr Viktorin
2013-01-23 09:35:55 -05:00
committed by Martin Kosek
parent f8ad7cb96f
commit e815c1893d
6 changed files with 13 additions and 18 deletions

View File

@@ -308,8 +308,8 @@ def del_link(realm, replica1, replica2, dirman_passwd, force=False):
entries = repl1.conn.get_entries(dn, ldap.SCOPE_SUBTREE)
if entries:
entries.sort(key=len, reverse=True)
for dn in entries:
repl1.conn.deleteEntry(dn)
for entry in entries:
repl1.conn.delete_entry(entry)
except Exception, e:
print "Error deleting winsync replica shared info: %s" % convert_error(e)

View File

@@ -104,7 +104,7 @@ class KrbInstance(service.Service):
service_dn = DN(('krbprincipalname', principal), self.get_realm_suffix())
service_entry = self.admin_conn.getEntry(service_dn, ldap.SCOPE_BASE)
self.admin_conn.deleteEntry(service_dn)
self.admin_conn.delete_entry(service_entry)
# Create a host entry for this master
host_dn = DN(
@@ -263,7 +263,7 @@ class KrbInstance(service.Service):
"(objectclass=nsSaslMapping)")
for r in res:
try:
self.admin_conn.delete_entry(r.dn)
self.admin_conn.delete_entry(r)
except Exception, e:
root_logger.critical(
"Error during SASL mapping removal: %s", e)

View File

@@ -835,7 +835,7 @@ class LDAPUpdate:
try:
self.info("Deleting entry %s", dn)
if self.live_run:
self.conn.deleteEntry(dn)
self.conn.delete_entry(dn)
self.modified = True
except errors.NotFound, e:
self.info("%s did not exist:%s", dn, e)

View File

@@ -734,7 +734,7 @@ class ReplicationManager(object):
"""
if dn is None:
cn, dn = self.agreement_dn(hostname)
return self.conn.deleteEntry(dn)
return self.conn.delete_entry(dn)
def delete_referral(self, hostname):
dn = DN(('cn', self.suffix), ('cn', 'mapping tree'), ('cn', 'config'))
@@ -1094,8 +1094,8 @@ class ReplicationManager(object):
filter='(krbprincipalname=*/%s@%s)' % (replica, realm))
if entries:
entries.sort(key=len, reverse=True)
for dn in entries:
self.conn.deleteEntry(dn)
for entry in entries:
self.conn.delete_entry(entry)
except errors.NotFound:
pass
except Exception, e:
@@ -1136,8 +1136,8 @@ class ReplicationManager(object):
entries = self.conn.get_entries(dn, ldap.SCOPE_SUBTREE)
if entries:
entries.sort(key=len, reverse=True)
for dn in entries:
self.conn.deleteEntry(dn)
for entry in entries:
self.conn.delete_entry(entry)
except errors.NotFound:
pass
except Exception, e:
@@ -1152,8 +1152,8 @@ class ReplicationManager(object):
entries = self.conn.get_entries(
basedn, ldap.SCOPE_SUBTREE, filter=filter)
if len(entries) != 0:
for e in entries:
self.conn.deleteEntry(e.dn)
for entry in entries:
self.conn.delete_entry(entry)
except errors.NotFound:
pass
except Exception, e:

View File

@@ -195,7 +195,7 @@ class Service(object):
return None
newdn = DN(('krbprincipalname', principal), ('cn', 'services'), ('cn', 'accounts'), self.suffix)
hostdn = DN(('fqdn', self.fqdn), ('cn', 'computers'), ('cn', 'accounts'), self.suffix)
self.admin_conn.deleteEntry(dn)
self.admin_conn.delete_entry(entry)
entry.dn = newdn
classes = entry.get("objectclass")
classes = classes + ["ipaobject", "ipaservice", "pkiuser"]

View File

@@ -1727,11 +1727,6 @@ class IPAdmin(LDAPClient):
self.modify_s(dn, modlist)
return True
def deleteEntry(self, dn):
# FIXME: for backwards compatibility only
self.delete_entry(dn)
return True
def waitForEntry(self, dn, timeout=7200, attr='', quiet=True):
scope = ldap.SCOPE_BASE
filter = "(objectclass=*)"