diff --git a/shaper/renderer.py b/shaper/renderer.py index 42f29f1..d0df939 100644 --- a/shaper/renderer.py +++ b/shaper/renderer.py @@ -4,7 +4,6 @@ from __future__ import print_function import os -from collections import OrderedDict import yaml from jinja2 import Environment, FileSystemLoader, Undefined @@ -57,15 +56,14 @@ def merge_templates(rendered_templates, out_dir): :param rendered_templates: list of rendered templates to merge - :param out_dir: path to rendered property files + :param out_dir: path to rendered templates :return: None """ - datastructure = {} + dict_base = {} for var in rendered_templates: - datastructure.update(yaml.safe_load(var)) + dict_base.update(yaml.safe_load(var)) - datastructure = manager.backward_path_parser(datastructure) - for key in datastructure: - datastructure[key] = OrderedDict((k, v) for k, v in sorted(datastructure[key].items())) - manager.write_properties(datastructure, out_dir) + manager.create_folders(out_dir) + with open(os.path.join(out_dir, 'templates.yaml'), 'w') as _fd: + yaml.dump(dict_base, _fd, default_flow_style=False)