From 566a40b148bbbb9bd9310b41a776deb39ab5e48a Mon Sep 17 00:00:00 2001 From: Steven Hardy Date: Thu, 1 Jun 2017 11:25:06 +0100 Subject: Modify generic role template to support custom networks Render all per-network resources and interfaces via j2 to enable future support for custom networks via network_data.yaml Note this doesn't enable custom networks for the built-in roles as we skip j2 rendering for them, this will be resolved by converting them to use the generic role template instead of the hard-coded ones listed in the j2_excludes.yaml. Depends-On: I18fa3829ff38ac200550d8e36bbe334c0005da22 Change-Id: I49565f9389f3ec9aef4861e23a3bed64a85501e6 Partially-Implements: blueprint composable-networks --- tools/process-templates.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'tools/process-templates.py') diff --git a/tools/process-templates.py b/tools/process-templates.py index c7d5ed9e..badc1426 100755 --- a/tools/process-templates.py +++ b/tools/process-templates.py @@ -146,13 +146,15 @@ def process_templates(template_path, role_data_path, output_dir, out_f_path = os.path.join(out_dir, out_f) if not (out_f_path in excl_templates): if '{{role.name}}' in template_data: - j2_data = {'role': r_map[role]} + j2_data = {'role': r_map[role], + 'networks': network_data} _j2_render_to_file(template_data, j2_data, out_f_path, overwrite) else: # Backwards compatibility with templates # that specify {{role}} vs {{role.name}} - j2_data = {'role': role} + j2_data = {'role': role, + 'networks': network_data} # (dprince) For the undercloud installer we # don'twant to have heat check nova/glance # API's -- cgit 1.2.3-korg