diff --git a/conductor/helpers.py b/conductor/helpers.py index b22eec3..0e0b7b9 100644 --- a/conductor/helpers.py +++ b/conductor/helpers.py @@ -14,6 +14,7 @@ # limitations under the License. import types +import deep def transform_json(json, mappings): @@ -42,7 +43,16 @@ def transform_json(json, mappings): def merge_lists(list1, list2): - return list1 + list2 + result = [] + for item in list1 + list2: + exists = False + for old_item in result: + if deep.diff(item, old_item) is None: + exists = True + break + if not exists: + result.append(item) + return result def merge_dicts(dict1, dict2, max_levels=0): diff --git a/tools/pip-requires b/tools/pip-requires index ed21b98..4ea32bf 100644 --- a/tools/pip-requires +++ b/tools/pip-requires @@ -9,3 +9,4 @@ python-heatclient #http://tarballs.openstack.org/oslo-config/oslo-config-2013.1b4.tar.gz#egg=oslo-config oslo.config +deep diff --git a/tools/test-requires b/tools/test-requires index 842d565..37e0bec 100644 --- a/tools/test-requires +++ b/tools/test-requires @@ -7,4 +7,3 @@ nosexcover pep8 sphinx>=1.1.2 mockfs -deep