Xen Test Framework
mkinfo.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
3 import json
4 import sys
5 
6 # Usage: mkcfg.py $OUT $NAME $CATEGORY $ENVS $VARIATIONS
7 _, out, name, cat, envs, variations = sys.argv
8 
9 template = {
10  "name": name,
11  "category": cat,
12  "environments": [],
13  "variations": [],
14  }
15 
16 if envs:
17  template["environments"] = envs.split(" ")
18 if variations:
19  template["variations"] = variations.split(" ")
20 
21 open(out, "w").write(
22  json.dumps(template, indent=4, separators=(',', ': '))
23  + "\n"
24  )