diff options
author | Carlos Camacho <ccamacho@redhat.com> | 2017-02-02 10:46:55 +0100 |
---|---|---|
committer | Carlos Camacho <ccamacho@redhat.com> | 2017-02-02 10:52:42 +0100 |
commit | e5d594ea2de6c4b387f32d0a6cea49accf940454 (patch) | |
tree | e329dca71dcbc33dbd6df5260e4112aac45adb5a /tools | |
parent | 8ea67bb6747c27584edf020dbaa68e07a34f40b8 (diff) |
Moving the validation for using the template alias version for all templates
Currently we are applying this validation for the services templates, this
submission moves it to run with all templates.
Also fixed those templates not using the alias name.
Change-Id: I3a2c0ce6adcc8061fdc51f73fdc6b9748c0fead9
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/yaml-validate.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/tools/yaml-validate.py b/tools/yaml-validate.py index 19e40d19..2769c152 100755 --- a/tools/yaml-validate.py +++ b/tools/yaml-validate.py @@ -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) |