X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=solution%2Fdev%2Fves-test-collector%2Fclient-scripts-ves-v7%2FglobalVesEventEmitter.py;fp=solution%2Fdev%2Fves-test-collector%2Fclient-scripts-ves-v7%2FglobalVesEventEmitter.py;h=f9a1fd9654e893d2124312fc8e061a6c62d1372a;hb=f9e11bbaa0d9db27bd418a1e7b2634a54cdf054f;hp=30d596f11faaee802b5565cd5ddad5c181d65e49;hpb=562a65a378c3ce3df48947a1a335b89f59f17940;p=oam.git diff --git a/solution/dev/ves-test-collector/client-scripts-ves-v7/globalVesEventEmitter.py b/solution/dev/ves-test-collector/client-scripts-ves-v7/globalVesEventEmitter.py index 30d596f..f9a1fd9 100644 --- a/solution/dev/ves-test-collector/client-scripts-ves-v7/globalVesEventEmitter.py +++ b/solution/dev/ves-test-collector/client-scripts-ves-v7/globalVesEventEmitter.py @@ -52,3 +52,12 @@ def getInitData(domain): Path(result["outdir"]).mkdir(parents=True, exist_ok=True) return result + +def saveExample(data): + if 'directory' in data and 'domain' in data and 'body' in data: + outputFileName = data['directory'] + '/json/examples/' + data['domain'] + '.json' + with open(outputFileName, 'w') as f: + json.dump(data['body'], f, indent=2, sort_keys=True) + else: + print("Example could not been saved:\n" + json.dump(data, f, indent=2, sort_keys=True)) + \ No newline at end of file