diff options
Diffstat (limited to 'tools/yaml-validate.py')
-rwxr-xr-x | tools/yaml-validate.py | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/tools/yaml-validate.py b/tools/yaml-validate.py index 63e3ce51..0eacbc60 100755 --- a/tools/yaml-validate.py +++ b/tools/yaml-validate.py @@ -66,7 +66,10 @@ def validate_mysql_connection(settings): def validate_mysql_uri(key, items): # Only consider a connection if it targets mysql - if key.endswith('connection') and \ + # TODO(owalsh): skip nova mysql uris,temporary workaround for + # tripleo/+bug/1662344 + if not key.startswith('nova') and \ + key.endswith('connection') and \ search(items, mysql_protocol, no_op): # Assume the "bind_address" option is one of # the token that made up the uri @@ -94,10 +97,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 +134,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) @@ -196,8 +202,8 @@ if base_endpoint_map and \ matches = validate_endpoint_map(base_endpoint_map, env_endpoint_map['map']) if not matches: - print("ERROR: %s doesn't match base endpoint map" % - env_endpoint_map['file']) + print("ERROR: %s needs to be updated to match changes in base " + "endpoint map" % env_endpoint_map['file']) failed_files.append(env_endpoint_map['file']) exit_val |= 1 else: |