Fix: cookiecutter folder must be on top
Change-Id: Id8fa734f9d59acae4cd0c640a9a6800d7421ddd6
diff --git a/reclass_tools/create_inventory.py b/reclass_tools/create_inventory.py
index a427c0d..a8e048b 100644
--- a/reclass_tools/create_inventory.py
+++ b/reclass_tools/create_inventory.py
@@ -80,7 +80,7 @@
return current_underlay_context
-def render_dir(template_dir, output_dir, contexts, env_name):
+def render_dir(template_dir, output_dir, contexts, env_name=None):
"""Coockiecutter echancement to use several source JSON files
:param template_dir: directory with templates to render
@@ -115,7 +115,8 @@
merged_context = helpers.merge_nested_objects(merged_context, context)
merged_context['toyaml'] = toyaml
- merged_context['_environment_name'] = env_name
+ if env_name:
+ merged_context['cookiecutter']['_environment_name'] = env_name
try:
generate.generate_files(