Incorrect merging of lists in template files
Change-Id: I884104f92304ea1fb9a538469f3c011ac15834e6
This commit is contained in:
parent
9fd4ebece2
commit
87c66644e8
@ -14,6 +14,7 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
import types
|
import types
|
||||||
|
import deep
|
||||||
|
|
||||||
|
|
||||||
def transform_json(json, mappings):
|
def transform_json(json, mappings):
|
||||||
@ -42,7 +43,16 @@ def transform_json(json, mappings):
|
|||||||
|
|
||||||
|
|
||||||
def merge_lists(list1, list2):
|
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):
|
def merge_dicts(dict1, dict2, max_levels=0):
|
||||||
|
@ -9,3 +9,4 @@ python-heatclient
|
|||||||
|
|
||||||
#http://tarballs.openstack.org/oslo-config/oslo-config-2013.1b4.tar.gz#egg=oslo-config
|
#http://tarballs.openstack.org/oslo-config/oslo-config-2013.1b4.tar.gz#egg=oslo-config
|
||||||
oslo.config
|
oslo.config
|
||||||
|
deep
|
||||||
|
@ -7,4 +7,3 @@ nosexcover
|
|||||||
pep8
|
pep8
|
||||||
sphinx>=1.1.2
|
sphinx>=1.1.2
|
||||||
mockfs
|
mockfs
|
||||||
deep
|
|
||||||
|
Loading…
Reference in New Issue
Block a user