X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=kubernetes%2Frobot%2Fresources%2Fconfig%2Feteshare%2Fconfig%2Fintegration_preload_parameters.py;h=aa97252f09c55dae925ed196689a3287f0239651;hb=960c8f474ac54dabc43fb0864240db2de71b08bb;hp=0ae1047529f95af4c8f37ae61fd7564a940d4786;hpb=44742a297336c3dae6ac00450d19f53806d64dc1;p=oom.git diff --git a/kubernetes/robot/resources/config/eteshare/config/integration_preload_parameters.py b/kubernetes/robot/resources/config/eteshare/config/integration_preload_parameters.py index 0ae1047529..aa97252f09 100644 --- a/kubernetes/robot/resources/config/eteshare/config/integration_preload_parameters.py +++ b/kubernetes/robot/resources/config/eteshare/config/integration_preload_parameters.py @@ -12,6 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. +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 "defaults" : { @@ -503,3 +509,33 @@ GLOBAL_PRELOAD_PARAMETERS = { } } } + + +# Create dictionaries for new MAPPING data to join to original MAPPING data +GLOBAL_PRELOAD_PARAMETERS2 = {} + + +folder=os.path.join('/var/opt/ONAP/demo/preload_data') +subfolders = [d for d in os.listdir(folder) if os.path.isdir(os.path.join(folder, d))] + +for service in subfolders: + filepath=os.path.join('/var/opt/ONAP/demo/preload_data', service, 'preload_data.json') + with open(filepath, 'r') as f: + preload_data = json.load(f) + GLOBAL_PRELOAD_PARAMETERS2['Demo']=preload_data + + +# Merge dictionaries +# 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 +