From cb8815bcf5a9e6ab737e8cde21a872eab13e7801 Mon Sep 17 00:00:00 2001 From: Simon Pichugin Date: Mon, 25 Sep 2017 08:32:21 +0200 Subject: [PATCH] Issue 99 - Fix typo in create_topology Description: We need to use the roles from the 'for' loop while creating agreements. If we don't, we will have failures while creating 'asymmetric' setups like two masters and one consumer. https://pagure.io/lib389/issue/99 Reviewed by: ? --- lib389/topologies.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib389/topologies.py b/lib389/topologies.py index 1ffc09e..674f1d0 100644 --- a/lib389/topologies.py +++ b/lib389/topologies.py @@ -93,11 +93,11 @@ def create_topology(topo_dict): continue # Create agreements: master -> masters, consumers - for inst_num_from in range(1, topo_dict[role]+1): + for inst_num_from in range(1, topo_dict[role_from]+1): roles_to = [ReplicaRole.MASTER, ReplicaRole.CONSUMER] for role_to in [role for role in topo_dict if role in roles_to]: - for inst_num_to in range(1, topo_dict[role]+1): + for inst_num_to in range(1, topo_dict[role_to]+1): # Exclude the instance we created it from if role_from != role_to or inst_num_from != inst_num_to: inst_from_id = "{}{}".format(role_from.name.lower(), inst_num_from) -- 2.13.5