summaryrefslogtreecommitdiffstats
path: root/ipaserver/install/replication.py
diff options
context:
space:
mode:
authorMartin Kosek <mkosek@redhat.com>2012-01-04 19:47:52 +0100
committerMartin Kosek <mkosek@redhat.com>2012-01-13 09:10:50 +0100
commit5550ee16071e5a1cf6c3a0f58c15865d730fe1e4 (patch)
treed16c3baba79c16e0fe3c757d90c905bb9ddd2724 /ipaserver/install/replication.py
parent4622812a4f41568ca0c77dbc5a2409dda8b843af (diff)
downloadfreeipa-5550ee16071e5a1cf6c3a0f58c15865d730fe1e4.tar.gz
freeipa-5550ee16071e5a1cf6c3a0f58c15865d730fe1e4.tar.xz
freeipa-5550ee16071e5a1cf6c3a0f58c15865d730fe1e4.zip
Fix LDAP add calls in replication module
Replace conn.add_s(entry) with conn.addEntry(entry) to avoid function calls with an invalid number of parameters. https://fedorahosted.org/freeipa/ticket/2139
Diffstat (limited to 'ipaserver/install/replication.py')
-rw-r--r--ipaserver/install/replication.py22
1 files changed, 11 insertions, 11 deletions
diff --git a/ipaserver/install/replication.py b/ipaserver/install/replication.py
index a139fd0fb..74685ef0f 100644
--- a/ipaserver/install/replication.py
+++ b/ipaserver/install/replication.py
@@ -227,8 +227,8 @@ class ReplicationManager(object):
ent.setValues("sn", "replication manager pseudo user")
try:
- conn.add_s(ent)
- except ldap.ALREADY_EXISTS:
+ conn.addEntry(ent)
+ except errors.DuplicateEntry:
conn.modify_s(dn, [(ldap.MOD_REPLACE, "userpassword", pw)])
pass
@@ -277,7 +277,7 @@ class ReplicationManager(object):
entry.setValues('nsds5replicabinddn', [replica_binddn])
entry.setValues('nsds5replicalegacyconsumer', "off")
- conn.add_s(entry)
+ conn.addEntry(entry)
def setup_changelog(self, conn):
dn = "cn=changelog5, cn=config"
@@ -287,8 +287,8 @@ class ReplicationManager(object):
entry.setValues('cn', "changelog5")
entry.setValues('nsslapd-changelogdir', dirpath)
try:
- conn.add_s(entry)
- except ldap.ALREADY_EXISTS:
+ conn.addEntry(entry)
+ except errors.DuplicateEntry:
return
def setup_chaining_backend(self, conn):
@@ -310,11 +310,11 @@ class ReplicationManager(object):
entry.setValues('nsmultiplexorbinddn', self.repl_man_dn)
entry.setValues('nsmultiplexorcredentials', self.repl_man_passwd)
- self.conn.add_s(entry)
+ self.conn.addEntry(entry)
done = True
- except ldap.ALREADY_EXISTS:
+ except errors.DuplicateEntry:
benum += 1
- except ldap.LDAPError, e:
+ except errors.ExecutionError, e:
print "Could not add backend entry " + dn, e
raise
@@ -378,7 +378,7 @@ class ReplicationManager(object):
entry.setValues("objectclass", ["account", "simplesecurityobject"])
entry.setValues("uid", "passsync")
entry.setValues("userPassword", password)
- conn.add_s(entry)
+ conn.addEntry(entry)
# Add it to the list of users allowed to bypass password policy
extop_dn = "cn=ipa_pwd_extop,cn=plugins,cn=config"
@@ -476,7 +476,7 @@ class ReplicationManager(object):
if iswinsync:
self.setup_winsync_agmt(entry, win_subtree)
- a_conn.add_s(entry)
+ a_conn.addEntry(entry)
try:
mod = [(ldap.MOD_ADD, 'nsDS5ReplicatedAttributeListTotal',
@@ -765,7 +765,7 @@ class ReplicationManager(object):
entry.setValues("ipaConfigString", "winsync:%s" % self.hostname)
try:
- self.conn.add_s(entry)
+ self.conn.addEntry(entry)
except Exception, e:
root_logger.info("Failed to create public entry for winsync replica")