mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
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
This commit is contained in:
committed by
Rob Crittenden
parent
94d457e83c
commit
6341eff078
@@ -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):
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user