mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
* Minor fix. Fixes #31196 * Disable complex list comparison and merge. Fixes #31196
This commit is contained in:
parent
9b896ca712
commit
431042da8e
1 changed files with 3 additions and 22 deletions
|
@ -347,27 +347,8 @@ class OC(object):
|
||||||
_, changed = self.merge(value, node, changed)
|
_, changed = self.merge(value, node, changed)
|
||||||
|
|
||||||
elif isinstance(value, list) and key in destination.keys():
|
elif isinstance(value, list) and key in destination.keys():
|
||||||
try:
|
if destination[key] != source[key]:
|
||||||
if set(destination[key]) != set(destination[key] +
|
destination[key] = source[key]
|
||||||
source[key]):
|
|
||||||
destination[key] = list(set(destination[key] +
|
|
||||||
source[key]))
|
|
||||||
changed = True
|
|
||||||
except TypeError:
|
|
||||||
for new_dict in source[key]:
|
|
||||||
found = False
|
|
||||||
for old_dict in destination[key]:
|
|
||||||
if ('name' in old_dict.keys() and
|
|
||||||
'name' in new_dict.keys()):
|
|
||||||
if old_dict['name'] == new_dict['name']:
|
|
||||||
destination[key].remove(old_dict)
|
|
||||||
break
|
|
||||||
if old_dict == new_dict:
|
|
||||||
found = True
|
|
||||||
break
|
|
||||||
|
|
||||||
if not found:
|
|
||||||
destination[key].append(new_dict)
|
|
||||||
changed = True
|
changed = True
|
||||||
|
|
||||||
elif (key not in destination.keys() or
|
elif (key not in destination.keys() or
|
||||||
|
|
Loading…
Reference in a new issue