From 6341eff07891dfd4ed253081eb056ff6eb5aa573 Mon Sep 17 00:00:00 2001 From: Martin Kosek Date: Mon, 13 Aug 2012 09:38:24 +0200 Subject: 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 --- ipaserver/install/dsinstance.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'ipaserver/install/dsinstance.py') diff --git a/ipaserver/install/dsinstance.py b/ipaserver/install/dsinstance.py index bf667738..5e6aa051 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): -- cgit