Created
December 14, 2015 16:38
-
-
Save d0ugal/fa5a1302120a70762513 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Call with: python mkplan.py tripleo-heat-templates > plan.json | |
| import sys | |
| import yaml | |
| template_path = sys.argv[1] | |
| import os | |
| templates_dict = {} | |
| for root, dirs, files in os.walk(template_path): | |
| for f in files: | |
| full_path = os.path.join(root, f) | |
| with open(full_path) as ff: | |
| if not full_path.endswith('.yaml'): | |
| continue | |
| full_path = full_path.replace("tripleo-heat-templates/", "") | |
| templates_dict[full_path] = {'contents': ff.read().decode("latin1")} | |
| #print repr(full_path) | |
| import json | |
| templates_dict['capabilities_map.yaml']['meta'] = { | |
| 'file-type': 'capabilities-map', | |
| } | |
| print json.dumps({"name": "overcloud", "files": templates_dict}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment