summaryrefslogtreecommitdiffstats
path: root/ipaserver
diff options
context:
space:
mode:
authorMartin Kosek <mkosek@redhat.com>2012-08-13 09:38:24 +0200
committerRob Crittenden <rcritten@redhat.com>2012-08-12 23:26:16 -0400
commit6341eff07891dfd4ed253081eb056ff6eb5aa573 (patch)
treee11d50cfa179389dc05b1405653e5afe581b0cc3 /ipaserver
parent94d457e83c172320707fbf13f7a1587dad128ece (diff)
downloadfreeipa-6341eff07891dfd4ed253081eb056ff6eb5aa573.tar.gz
freeipa-6341eff07891dfd4ed253081eb056ff6eb5aa573.tar.xz
freeipa-6341eff07891dfd4ed253081eb056ff6eb5aa573.zip
Fix winsync agreements creation
Due to recent addition of ID range support to DsInstance, the class could no longer be instantiated when realm_name was passed but ID range parameters were not. This condition broke winsync agreements creation in ipa-replica-manage. Make sure that ID range computation in DsInstance does not crash in this cases so that winsync replica can be created. Also convert --binddn option of ipa-replica-manage script to IPA native DN type so that setup_agreement does not crash. https://fedorahosted.org/freeipa/ticket/2987
Diffstat (limited to 'ipaserver')
-rw-r--r--ipaserver/install/dsinstance.py6
-rw-r--r--ipaserver/install/replication.py2
2 files changed, 6 insertions, 2 deletions
diff --git a/ipaserver/install/dsinstance.py b/ipaserver/install/dsinstance.py
index bf6677381..5e6aa0512 100644
--- a/ipaserver/install/dsinstance.py
+++ b/ipaserver/install/dsinstance.py
@@ -313,6 +313,10 @@ class DsInstance(service.Service):
def __setup_sub_dict(self):
server_root = find_server_root()
+ try:
+ idrange_size = self.idmax - self.idstart + 1
+ except TypeError:
+ idrange_size = None
self.sub_dict = dict(FQDN=self.fqdn, SERVERID=self.serverid,
PASSWORD=self.dm_password,
RANDOM_PASSWORD=self.generate_random(),
@@ -323,7 +327,7 @@ class DsInstance(service.Service):
IDMAX=self.idmax, HOST=self.fqdn,
ESCAPED_SUFFIX=str(self.suffix),
GROUP=DS_GROUP,
- IDRANGE_SIZE=self.idmax-self.idstart+1
+ IDRANGE_SIZE=idrange_size
)
def __create_ds_user(self):
diff --git a/ipaserver/install/replication.py b/ipaserver/install/replication.py
index 8fe73ca77..950e8ffc6 100644
--- a/ipaserver/install/replication.py
+++ b/ipaserver/install/replication.py
@@ -818,7 +818,7 @@ class ReplicationManager(object):
ad_conn.set_option(ldap.OPT_X_TLS_CACERTFILE, cacert)
ad_conn.set_option(ldap.OPT_X_TLS_NEWCTX, 0)
ad_conn.start_tls_s()
- ad_conn.simple_bind_s(ad_binddn, ad_pwd)
+ ad_conn.simple_bind_s(str(ad_binddn), ad_pwd)
res = ad_conn.search_s("", ldap.SCOPE_BASE, '(objectClass=*)',
['defaultNamingContext'])
for dn,entry in res: