From 431042da8ecd7de347b4336d3a2e1f0d1652e8e7 Mon Sep 17 00:00:00 2001 From: Luka Date: Wed, 8 Nov 2017 03:52:43 +0100 Subject: [PATCH] OC Module - Disable complex list merging. Fixes #31196 (#31387) * Minor fix. Fixes #31196 * Disable complex list comparison and merge. Fixes #31196 --- lib/ansible/modules/clustering/oc.py | 25 +++---------------------- 1 file changed, 3 insertions(+), 22 deletions(-) diff --git a/lib/ansible/modules/clustering/oc.py b/lib/ansible/modules/clustering/oc.py index a53064277d7..0fdae9dcb89 100644 --- a/lib/ansible/modules/clustering/oc.py +++ b/lib/ansible/modules/clustering/oc.py @@ -347,28 +347,9 @@ class OC(object): _, changed = self.merge(value, node, changed) elif isinstance(value, list) and key in destination.keys(): - try: - if set(destination[key]) != set(destination[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 + if destination[key] != source[key]: + destination[key] = source[key] + changed = True elif (key not in destination.keys() or destination[key] != source[key]):