Skip to content

Commit

Permalink
fix incorrect suffix handling in topology checks
Browse files Browse the repository at this point in the history
When trying to delete a partially removed master entry lacking
'iparepltopomanagedsuffix' attribute, the code that tries to retrieve
tha value for further computations passes None and causes unhandled
internal errors.

If the attribute is empty or not present, we should return empty list
instead as to not break calling cod attribute, the code that tries to
retrieve tha value for further computations passes None and causes
unhandled internal errors. We should return empty list instead.

https://pagure.io/freeipa/issue/6965

Reviewed-By: Felipe Volpone <[email protected]>
  • Loading branch information
Martin Babinsky committed Jun 5, 2017
1 parent e8a7e2e commit 8ef4888
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions ipaserver/topology.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,15 @@ def get_topology_connection_errors(graph):

def map_masters_to_suffixes(masters):
masters_to_suffix = {}
managed_suffix_attr = 'iparepltopomanagedsuffix_topologysuffix'

for master in masters:
try:
managed_suffixes = master.get(
'iparepltopomanagedsuffix_topologysuffix')
except KeyError:
if managed_suffix_attr not in master:
continue

managed_suffixes = master[managed_suffix_attr]

if managed_suffixes is None:
continue

for suffix_name in managed_suffixes:
Expand Down

0 comments on commit 8ef4888

Please sign in to comment.