mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Inline inactivateEntry in its only caller
Part of the work for: https://fedorahosted.org/freeipa/ticket/2660
This commit is contained in:
parent
5184c312f6
commit
fc571da1af
@ -442,7 +442,9 @@ class KrbInstance(service.Service):
|
||||
# Create the special anonymous principal
|
||||
installutils.kadmin_addprinc(princ_realm)
|
||||
dn = DN(('krbprincipalname', princ_realm), self.get_realm_suffix())
|
||||
self.admin_conn.inactivateEntry(dn, False)
|
||||
entry = self.admin_conn.get_entry(dn)
|
||||
entry['nsAccountlock'] = ['TRUE']
|
||||
self.admin_conn.update_entry(entry)
|
||||
|
||||
def __convert_to_gssapi_replication(self):
|
||||
repl = replication.ReplicationManager(self.realm,
|
||||
|
@ -1697,25 +1697,6 @@ class IPAdmin(LDAPClient):
|
||||
|
||||
return modlist
|
||||
|
||||
def inactivateEntry(self,dn, has_key):
|
||||
"""Rather than deleting entries we mark them as inactive.
|
||||
has_key defines whether the entry already has nsAccountlock
|
||||
set so we can determine which type of mod operation to run."""
|
||||
|
||||
assert isinstance(dn, DN)
|
||||
modlist = []
|
||||
|
||||
if has_key:
|
||||
operation = ldap.MOD_REPLACE
|
||||
else:
|
||||
operation = ldap.MOD_ADD
|
||||
|
||||
modlist.append((operation, "nsAccountlock", "TRUE"))
|
||||
|
||||
with self.error_handler():
|
||||
self.modify_s(dn, modlist)
|
||||
return True
|
||||
|
||||
def waitForEntry(self, dn, timeout=7200, attr='', quiet=True):
|
||||
filter = "(objectclass=*)"
|
||||
attrlist = []
|
||||
|
Loading…
Reference in New Issue
Block a user