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