Merge "Moving the validation for using the template alias version for all templates"

This commit is contained in:
Jenkins 2017-02-03 09:20:41 +00:00 committed by Gerrit Code Review
commit ec24ed7dd8
3 changed files with 9 additions and 6 deletions

View File

@ -1,4 +1,4 @@
heat_template_version: 2016-10-14
heat_template_version: ocata
description: >
Software Config to drive os-net-config for a simple bridge configured

View File

@ -1,4 +1,4 @@
heat_template_version: 2013-05-23
heat_template_version: ocata
description: >
This template resides in tripleo-ci for Mitaka CI jobs only.

View File

@ -94,10 +94,6 @@ def validate_mysql_connection(settings):
def validate_service(filename, tpl):
if 'heat_template_version' in tpl and not str(tpl['heat_template_version']).isalpha():
print('ERROR: heat_template_version needs to be the release alias not a date: %s'
% filename)
return 1
if 'outputs' in tpl and 'role_data' in tpl['outputs']:
if 'value' not in tpl['outputs']['role_data']:
print('ERROR: invalid role_data for filename: %s'
@ -135,6 +131,13 @@ def validate(filename):
try:
tpl = yaml.load(open(filename).read())
# The template alias version should be used instead a date, this validation
# will be applied to all templates not just for those in the services folder.
if 'heat_template_version' in tpl and not str(tpl['heat_template_version']).isalpha():
print('ERROR: heat_template_version needs to be the release alias not a date: %s'
% filename)
return 1
if (filename.startswith('./puppet/services/') and
filename != './puppet/services/services.yaml'):
retval = validate_service(filename, tpl)