Skip to content

Commit

Permalink
feat: now compare weights at the same hierarchy level
Browse files Browse the repository at this point in the history
  • Loading branch information
stmosher committed Sep 14, 2023
1 parent 56d61f9 commit a5e6101
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions plugins/modules/mdd_combine.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,10 @@ def _merge(result_cfgs, v, path=None, filepath=None, hierarchy_level=None, playb
elif k in result_cfgs and hierarchy_level == result_cfgs[k][3] and result_cfgs[k][0] and weight > \
result_cfgs[k][4]:
result_cfgs[k] = (v, filepath, playbook_tags, hierarchy_level, weight)
# if key found multiple places at same hierarchy level and the new key's weight is lower, pass.
# if key found multiple places at same hierarchy level and the new key's weight is lower, skip.
elif k in result_cfgs and hierarchy_level == result_cfgs[k][3] and result_cfgs[k][0] and weight < \
result_cfgs[k][4]:
pass
continue
# if key found multiple places at same hierarchy level and if the weight is the same, error.
elif k in result_cfgs and hierarchy_level == result_cfgs[k][3] and result_cfgs[k][0] and weight == \
result_cfgs[k][4]:
Expand Down

0 comments on commit a5e6101

Please sign in to comment.