summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Freeman <bf1936@att.com>2019-04-22 22:04:34 -0500
committerBrian Freeman <bf1936@att.com>2019-04-22 22:04:56 -0500
commit5faf0de55986aeb34eb01e39e51290fd1b072784 (patch)
tree38e69c622cac3813e92827e35294d3c1e6ead048
parent2f9822e2d5f01c59d3b1511d3f07730ed38ea837 (diff)
Fix dictionary merge
Previous version was overwriting Demo key with last preload_data.json structure instead of a merge. Have to iterate over keys Issue-ID: INT-1038 Change-Id: Ia15428b3aae7cbc681a96d50656d278b5ef07b42 Signed-off-by: Brian Freeman <bf1936@att.com>
-rw-r--r--resources/config/eteshare/config/integration_preload_parameters.py17
1 files changed, 15 insertions, 2 deletions
diff --git a/resources/config/eteshare/config/integration_preload_parameters.py b/resources/config/eteshare/config/integration_preload_parameters.py
index a673a16..aa97252 100644
--- a/resources/config/eteshare/config/integration_preload_parameters.py
+++ b/resources/config/eteshare/config/integration_preload_parameters.py
@@ -14,6 +14,9 @@
import json
import os.path
+from itertools import chain
+from collections import defaultdict
+
GLOBAL_PRELOAD_PARAMETERS = {
# heat template parameter values common to all heat template continaing these parameters
@@ -508,7 +511,6 @@ GLOBAL_PRELOAD_PARAMETERS = {
}
-
# Create dictionaries for new MAPPING data to join to original MAPPING data
GLOBAL_PRELOAD_PARAMETERS2 = {}
@@ -524,5 +526,16 @@ for service in subfolders:
# Merge dictionaries
-GLOBAL_PRELOAD_PARAMETERS = dict(GLOBAL_PRELOAD_PARAMETERS.items() + GLOBAL_PRELOAD_PARAMETERS2.items())
+# preload_data.json is for Demo key in GLOBAL_PRELOAD_PARAMETERS
+
+
+GLOBAL_PRELOAD_PARAMETERS3 = {'Demo':{}}
+
+for k, v in chain(GLOBAL_PRELOAD_PARAMETERS['Demo'].items(), GLOBAL_PRELOAD_PARAMETERS2['Demo'].items()):
+ GLOBAL_PRELOAD_PARAMETERS3['Demo'][k] = v
+# print(k, v)
+
+GLOBAL_PRELOAD_PARAMETERS = dict(GLOBAL_PRELOAD_PARAMETERS.items() + GLOBAL_PRELOAD_PARAMETERS3.items())
+
+#print GLOBAL_PRELOAD_PARAMETERS