Skip to content

Commit

Permalink
Revert "Combine play and write into one step (#39)" because it causes…
Browse files Browse the repository at this point in the history
… the issue with shaper play (#44) (#45)

This reverts commit 6e37ec4.
  • Loading branch information
Aliaksei-Tatarynchyk authored and arno49 committed Jun 3, 2019
1 parent badf43e commit cd7dd24
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions shaper/renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from __future__ import print_function

import os
from collections import OrderedDict
import yaml

from jinja2 import Environment, FileSystemLoader, Undefined
Expand Down Expand Up @@ -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)

0 comments on commit cd7dd24

Please sign in to comment.