summaryrefslogtreecommitdiffstats
path: root/cvp/3rd_party/static/testapi-ui/components/guidelines/data/gen.py
diff options
context:
space:
mode:
authorhongbo tian <hongbo.tianhongbo@huawei.com>2017-09-28 09:28:41 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-09-28 09:28:41 +0000
commit61820ee85c967d90021e4089c6a7907046685639 (patch)
tree0c3f23e2146f0855fb5be0ff55343d59e3a9c9ab /cvp/3rd_party/static/testapi-ui/components/guidelines/data/gen.py
parent0cc2fdefa9e6e959e7c69beede736738f339f636 (diff)
parent0cf6b232ac9cf128ee9183a27c08f4f74ab2e2e6 (diff)
Merge "add api&web services for cvp"
Diffstat (limited to 'cvp/3rd_party/static/testapi-ui/components/guidelines/data/gen.py')
-rw-r--r--cvp/3rd_party/static/testapi-ui/components/guidelines/data/gen.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/cvp/3rd_party/static/testapi-ui/components/guidelines/data/gen.py b/cvp/3rd_party/static/testapi-ui/components/guidelines/data/gen.py
new file mode 100644
index 00000000..34fb6941
--- /dev/null
+++ b/cvp/3rd_party/static/testapi-ui/components/guidelines/data/gen.py
@@ -0,0 +1,16 @@
+import json
+
+with open('danube.json') as f:
+ data = json.load(f)
+mapping = {}
+for i in data['mandatory']['value']:
+ for j in i['value']:
+ for k in j['value']:
+ mapping[k] = True
+for i in data['optional']['value']:
+ for j in i['value']:
+ for k in j['value']:
+ mapping[k] = False
+
+with open('mandatory.json', 'w') as f:
+ f.write(json.dumps(mapping))