13 lines
240 B
Python
Executable File
13 lines
240 B
Python
Executable File
#!/usr/bin/env python
|
|
import sys
|
|
import json
|
|
import yaml
|
|
|
|
# load from file:
|
|
with open(sys.argv[1], 'r') as f:
|
|
yaml_string = f.read()
|
|
|
|
# save to file:
|
|
with open(sys.argv[2], 'w') as f:
|
|
f.write(json.dumps({"cloud-init":yaml_string}))
|