Skip to content

Commit 431042d

Browse files
Lukabcoca
Luka
authored andcommitted
OC Module - Disable complex list merging. Fixes ansible#31196 (ansible#31387)
* Minor fix. Fixes ansible#31196 * Disable complex list comparison and merge. Fixes ansible#31196
1 parent 9b896ca commit 431042d

File tree

1 file changed

+3
-22
lines changed
  • lib/ansible/modules/clustering

1 file changed

+3
-22
lines changed

lib/ansible/modules/clustering/oc.py

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -347,28 +347,9 @@ def merge(self, source, destination, changed):
347347
_, changed = self.merge(value, node, changed)
348348

349349
elif isinstance(value, list) and key in destination.keys():
350-
try:
351-
if set(destination[key]) != set(destination[key] +
352-
source[key]):
353-
destination[key] = list(set(destination[key] +
354-
source[key]))
355-
changed = True
356-
except TypeError:
357-
for new_dict in source[key]:
358-
found = False
359-
for old_dict in destination[key]:
360-
if ('name' in old_dict.keys() and
361-
'name' in new_dict.keys()):
362-
if old_dict['name'] == new_dict['name']:
363-
destination[key].remove(old_dict)
364-
break
365-
if old_dict == new_dict:
366-
found = True
367-
break
368-
369-
if not found:
370-
destination[key].append(new_dict)
371-
changed = True
350+
if destination[key] != source[key]:
351+
destination[key] = source[key]
352+
changed = True
372353

373354
elif (key not in destination.keys() or
374355
destination[key] != source[key]):

0 commit comments

Comments
 (0)