diff options
Diffstat (limited to 'scripts/yaml2json.py.in')
-rw-r--r-- | scripts/yaml2json.py.in | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/scripts/yaml2json.py.in b/scripts/yaml2json.py.in new file mode 100644 index 0000000..ec9c8e8 --- /dev/null +++ b/scripts/yaml2json.py.in | |||
@@ -0,0 +1,9 @@ | |||
1 | @PYTHON@ | ||
2 | |||
3 | # Simple little YAML/JSON converter so we can maintain our Packer configs in a | ||
4 | # sane format that allows comments but also use Packer which only supports JSON | ||
5 | |||
6 | import yaml, json, sys | ||
7 | |||
8 | y = yaml.full_load(open(sys.argv[1])) | ||
9 | json.dump(y, sys.stdout, indent=4, separators=(',', ': ')) | ||