mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Replace addEntry with add_entry
Part of the work for: https://fedorahosted.org/freeipa/ticket/2660
This commit is contained in:
committed by
Martin Kosek
parent
aaa41b2145
commit
f8ad7cb96f
@@ -333,7 +333,7 @@ class ADTRUSTInstance(service.Service):
|
||||
return
|
||||
entry = self.admin_conn.make_entry(
|
||||
new_dn, objectclass=['nsContainer'], cn=[name])
|
||||
self.admin_conn.addEntry(entry)
|
||||
self.admin_conn.add_entry(entry)
|
||||
|
||||
entry = self.admin_conn.make_entry(
|
||||
self.smb_dom_dn,
|
||||
@@ -346,7 +346,7 @@ class ADTRUSTInstance(service.Service):
|
||||
}
|
||||
)
|
||||
#TODO: which MAY attributes do we want to set ?
|
||||
self.admin_conn.addEntry(entry)
|
||||
self.admin_conn.add_entry(entry)
|
||||
|
||||
def __write_smb_conf(self):
|
||||
self.fstore.backup_file(self.smb_conf)
|
||||
@@ -458,7 +458,7 @@ class ADTRUSTInstance(service.Service):
|
||||
cn=[self.smb_dn['cn']],
|
||||
member=[self.cifs_agent],
|
||||
)
|
||||
self.admin_conn.addEntry(entry)
|
||||
self.admin_conn.add_entry(entry)
|
||||
except Exception, e:
|
||||
# CIFS principal already exists, it is not the first time adtrustinstance is managed
|
||||
# That's fine, we we'll re-extract the key again.
|
||||
@@ -745,7 +745,7 @@ class ADTRUSTInstance(service.Service):
|
||||
ipaBaseID=[str(base_id)],
|
||||
ipaIDRangeSize=[str(id_range_size)],
|
||||
)
|
||||
self.admin_conn.addEntry(entry)
|
||||
self.admin_conn.add_entry(entry)
|
||||
|
||||
def create_instance(self):
|
||||
|
||||
|
||||
@@ -397,7 +397,7 @@ class CADSInstance(service.Service):
|
||||
nsSSLToken=["internal (software)"],
|
||||
nsSSLActivation=["on"],
|
||||
)
|
||||
conn.addEntry(entry)
|
||||
conn.add_entry(entry)
|
||||
|
||||
conn.unbind()
|
||||
|
||||
|
||||
@@ -578,7 +578,7 @@ class DsInstance(service.Service):
|
||||
nsSSLToken=["internal (software)"],
|
||||
nsSSLActivation=["on"],
|
||||
)
|
||||
conn.addEntry(entry)
|
||||
conn.add_entry(entry)
|
||||
|
||||
conn.unbind()
|
||||
|
||||
|
||||
@@ -131,7 +131,7 @@ class KrbInstance(service.Service):
|
||||
'krbpasswordexpiration']
|
||||
if 'krbticketflags' in service_entry.toDict():
|
||||
host_entry['krbticketflags'] = service_entry['krbticketflags']
|
||||
self.admin_conn.addEntry(host_entry)
|
||||
self.admin_conn.add_entry(host_entry)
|
||||
|
||||
def __common_setup(self, realm_name, host_name, domain_name, admin_password):
|
||||
self.fqdn = host_name
|
||||
@@ -282,7 +282,7 @@ class KrbInstance(service.Service):
|
||||
nsSaslMapBaseDNTemplate=[self.suffix],
|
||||
nsSaslMapFilterTemplate=['(krbPrincipalName=\\1@\\2)'],
|
||||
)
|
||||
self.admin_conn.addEntry(entry)
|
||||
self.admin_conn.add_entry(entry)
|
||||
|
||||
entry = self.admin_conn.make_entry(
|
||||
DN(
|
||||
@@ -295,7 +295,7 @@ class KrbInstance(service.Service):
|
||||
nsSaslMapFilterTemplate=[
|
||||
'(krbPrincipalName=&@%s)' % self.realm],
|
||||
)
|
||||
self.admin_conn.addEntry(entry)
|
||||
self.admin_conn.add_entry(entry)
|
||||
|
||||
def __add_krb_container(self):
|
||||
self._ldap_mod("kerberos.ldif", self.sub_dict)
|
||||
|
||||
@@ -428,7 +428,7 @@ class LDAPUpdate:
|
||||
self.debug("Task id: %s", dn)
|
||||
|
||||
if self.live_run:
|
||||
self.conn.addEntry(e)
|
||||
self.conn.add_entry(e)
|
||||
|
||||
return dn
|
||||
|
||||
@@ -769,7 +769,7 @@ class LDAPUpdate:
|
||||
# dn defined. In that case there is nothing to do.
|
||||
# It means the entry doesn't exist, so skip it.
|
||||
try:
|
||||
self.conn.addEntry(entry)
|
||||
self.conn.add_entry(entry)
|
||||
except errors.NotFound:
|
||||
# parent entry of the added entry does not exist
|
||||
# this may not be an error (e.g. entries in NIS container)
|
||||
|
||||
@@ -323,7 +323,7 @@ class ReplicationManager(object):
|
||||
)
|
||||
|
||||
try:
|
||||
conn.addEntry(ent)
|
||||
conn.add_entry(ent)
|
||||
except errors.DuplicateEntry:
|
||||
conn.modify_s(dn, [(ldap.MOD_REPLACE, "userpassword", pw)])
|
||||
pass
|
||||
@@ -377,7 +377,7 @@ class ReplicationManager(object):
|
||||
nsds5replicabinddn=[replica_binddn],
|
||||
nsds5replicalegacyconsumer=["off"],
|
||||
)
|
||||
conn.addEntry(entry)
|
||||
conn.add_entry(entry)
|
||||
|
||||
def setup_changelog(self, conn):
|
||||
ent = conn.get_entry(
|
||||
@@ -396,7 +396,7 @@ class ReplicationManager(object):
|
||||
}
|
||||
)
|
||||
try:
|
||||
conn.addEntry(entry)
|
||||
conn.add_entry(entry)
|
||||
except errors.DuplicateEntry:
|
||||
return
|
||||
|
||||
@@ -423,7 +423,7 @@ class ReplicationManager(object):
|
||||
'nsmultiplexorcredentials': [self.repl_man_passwd],
|
||||
}
|
||||
)
|
||||
self.conn.addEntry(entry)
|
||||
self.conn.add_entry(entry)
|
||||
done = True
|
||||
except errors.DuplicateEntry:
|
||||
benum += 1
|
||||
@@ -493,7 +493,7 @@ class ReplicationManager(object):
|
||||
uid=["passsync"],
|
||||
userPassword=[password],
|
||||
)
|
||||
conn.addEntry(entry)
|
||||
conn.add_entry(entry)
|
||||
|
||||
# Add it to the list of users allowed to bypass password policy
|
||||
extop_dn = DN(('cn', 'ipa_pwd_extop'), ('cn', 'plugins'), ('cn', 'config'))
|
||||
@@ -586,7 +586,7 @@ class ReplicationManager(object):
|
||||
if iswinsync:
|
||||
self.setup_winsync_agmt(entry, win_subtree)
|
||||
|
||||
a_conn.addEntry(entry)
|
||||
a_conn.add_entry(entry)
|
||||
|
||||
try:
|
||||
mod = [(ldap.MOD_ADD, 'nsDS5ReplicatedAttributeListTotal',
|
||||
@@ -969,7 +969,7 @@ class ReplicationManager(object):
|
||||
)
|
||||
|
||||
try:
|
||||
self.conn.addEntry(entry)
|
||||
self.conn.add_entry(entry)
|
||||
except Exception, e:
|
||||
root_logger.info("Failed to create public entry for winsync replica")
|
||||
|
||||
@@ -1225,7 +1225,7 @@ class ReplicationManager(object):
|
||||
}
|
||||
)
|
||||
try:
|
||||
self.conn.addEntry(e)
|
||||
self.conn.add_entry(e)
|
||||
except errors.DuplicateEntry:
|
||||
print "CLEANALLRUV task for replica id %d already exists." % replicaId
|
||||
else:
|
||||
@@ -1252,7 +1252,7 @@ class ReplicationManager(object):
|
||||
}
|
||||
)
|
||||
try:
|
||||
self.conn.addEntry(e)
|
||||
self.conn.add_entry(e)
|
||||
except errors.DuplicateEntry:
|
||||
print "An abort CLEANALLRUV task for replica id %d already exists." % replicaId
|
||||
else:
|
||||
|
||||
@@ -202,7 +202,7 @@ class Service(object):
|
||||
entry["objectclass"] = list(set(classes))
|
||||
entry["ipauniqueid"] = ['autogenerate']
|
||||
entry["managedby"] = [hostdn]
|
||||
self.admin_conn.addEntry(entry)
|
||||
self.admin_conn.add_entry(entry)
|
||||
return newdn
|
||||
|
||||
def add_simple_service(self, principal):
|
||||
@@ -225,7 +225,7 @@ class Service(object):
|
||||
ipauniqueid=['autogenerate'],
|
||||
managedby=[hostdn],
|
||||
)
|
||||
self.admin_conn.addEntry(entry)
|
||||
self.admin_conn.add_entry(entry)
|
||||
return dn
|
||||
|
||||
def add_cert_to_service(self):
|
||||
@@ -386,7 +386,7 @@ class Service(object):
|
||||
)
|
||||
|
||||
try:
|
||||
self.admin_conn.addEntry(entry)
|
||||
self.admin_conn.add_entry(entry)
|
||||
except (ldap.ALREADY_EXISTS, errors.DuplicateEntry), e:
|
||||
root_logger.debug("failed to add %s Service startup entry" % name)
|
||||
raise e
|
||||
|
||||
@@ -1632,11 +1632,6 @@ class IPAdmin(LDAPClient):
|
||||
)
|
||||
return result[0]
|
||||
|
||||
def addEntry(self, entry):
|
||||
# FIXME: for backwards compatibility only
|
||||
self.add_entry(entry.dn, entry)
|
||||
return True
|
||||
|
||||
def updateEntry(self,dn,oldentry,newentry):
|
||||
# FIXME: for backwards compatibility only
|
||||
"""This wraps the mod function. It assumes that the entry is already
|
||||
|
||||
Reference in New Issue
Block a user