In python, splitting an empty string results in a single-entry list containing
an empty string. This causes the variations list to be wrong when no
variations are in use.
It is only by chance that doesn't cause an issue for ./xtf-runner
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
template = {
"name": name,
"category": cat,
- "environments": envs.split(" "),
- "variations": variations.split(" "),
+ "environments": [],
+ "variations": [],
}
+if envs:
+ template["environments"] = envs.split(" ")
+if variations:
+ template["variations"] = variations.split(" ")
+
open(out, "w").write(
json.dumps(template, indent=4, separators=(',', ': '))
+ "\n"