summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rwxr-xr-xtools/process-templates.py26
-rwxr-xr-xtools/yaml-validate.py2
2 files changed, 20 insertions, 8 deletions
diff --git a/tools/process-templates.py b/tools/process-templates.py
index 69ed96a6..c7d5ed9e 100755
--- a/tools/process-templates.py
+++ b/tools/process-templates.py
@@ -138,19 +138,31 @@ def process_templates(template_path, role_data_path, output_dir,
print("jinja2 rendering roles %s" % ","
.join(role_names))
for role in role_names:
- j2_data = {'role': role}
- # (dprince) For the undercloud installer we don't
- # want to have heat check nova/glance API's
- if r_map[role].get('disable_constraints', False):
- j2_data['disable_constraints'] = True
+ j2_data = {'role': r_map[role]}
out_f = "-".join(
[role.lower(),
os.path.basename(f).replace('.role.j2.yaml',
'.yaml')])
out_f_path = os.path.join(out_dir, out_f)
if not (out_f_path in excl_templates):
- _j2_render_to_file(template_data, j2_data,
- out_f_path, overwrite)
+ if '{{role.name}}' in template_data:
+ j2_data = {'role': r_map[role]}
+ _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}
+ # (dprince) For the undercloud installer we
+ # don'twant to have heat check nova/glance
+ # API's
+ if r_map[role].get('disable_constraints',
+ False):
+ j2_data['disable_constraints'] = True
+ _j2_render_to_file(
+ template_data,j2_data,
+ out_f_path, overwrite)
+
else:
print('skipping rendering of %s' % out_f_path)
elif f.endswith('.j2.yaml'):
diff --git a/tools/yaml-validate.py b/tools/yaml-validate.py
index 674449f5..f9e89db2 100755
--- a/tools/yaml-validate.py
+++ b/tools/yaml-validate.py
@@ -38,7 +38,7 @@ OPTIONAL_DOCKER_SECTIONS = ['docker_puppet_tasks', 'upgrade_tasks',
'metadata_settings', 'kolla_config']
REQUIRED_DOCKER_PUPPET_CONFIG_SECTIONS = ['config_volume', 'step_config',
'config_image']
-OPTIONAL_DOCKER_PUPPET_CONFIG_SECTIONS = [ 'puppet_tags' ]
+OPTIONAL_DOCKER_PUPPET_CONFIG_SECTIONS = [ 'puppet_tags', 'volumes' ]
# Mapping of parameter names to a list of the fields we should _not_ enforce
# consistency across files on. This should only contain parameters whose
# definition we cannot change for backwards compatibility reasons. New