X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=tools%2Fyaml-validate.py;h=92d76d2372b938e356ba47a3b8af327f49c03b3c;hb=aca5ec7d4c6715d8f1d4f5f2e2c79d6c7a4f532f;hp=5bd6dcdd0966cf4e461dda37ab824dc8cfd77918;hpb=4795a1116850f8bb62e4b179b2190a482a63ac13;p=apex-tripleo-heat-templates.git diff --git a/tools/yaml-validate.py b/tools/yaml-validate.py index 5bd6dcdd..92d76d23 100755 --- a/tools/yaml-validate.py +++ b/tools/yaml-validate.py @@ -17,18 +17,21 @@ import traceback import yaml -required_params = ['EndpointMap', 'ServiceNetMap', 'DefaultPasswords'] +required_params = ['EndpointMap', 'ServiceNetMap', 'DefaultPasswords', + 'RoleName', 'RoleParameters'] envs_containing_endpoint_map = ['tls-endpoints-public-dns.yaml', 'tls-endpoints-public-ip.yaml', 'tls-everywhere-endpoints-dns.yaml'] ENDPOINT_MAP_FILE = 'endpoint_map.yaml' -REQUIRED_DOCKER_SECTIONS = ['service_name', 'docker_config', 'kolla_config', - 'puppet_config', 'config_settings', 'step_config'] +REQUIRED_DOCKER_SECTIONS = ['service_name', 'docker_config', 'puppet_config', + 'config_settings', 'step_config'] OPTIONAL_DOCKER_SECTIONS = ['docker_puppet_tasks', 'upgrade_tasks', - 'service_config_settings'] -DOCKER_PUPPET_CONFIG_SECTIONS = ['config_volume', 'puppet_tags', 'step_config', - 'config_image'] + 'service_config_settings', 'host_prep_tasks', + 'metadata_settings', 'kolla_config'] +REQUIRED_DOCKER_PUPPET_CONFIG_SECTIONS = ['config_volume', 'step_config', + 'config_image'] +OPTIONAL_DOCKER_PUPPET_CONFIG_SECTIONS = [ 'puppet_tags' ] def exit_usage(): @@ -145,13 +148,16 @@ def validate_docker_service(filename, tpl): if 'puppet_config' in role_data: puppet_config = role_data['puppet_config'] for key in puppet_config: - if key in DOCKER_PUPPET_CONFIG_SECTIONS: + if key in REQUIRED_DOCKER_PUPPET_CONFIG_SECTIONS: continue else: - print('ERROR: %s should not be in puppet_config section.' - % key) - return 1 - for key in DOCKER_PUPPET_CONFIG_SECTIONS: + if key in OPTIONAL_DOCKER_PUPPET_CONFIG_SECTIONS: + continue + else: + print('ERROR: %s should not be in puppet_config section.' + % key) + return 1 + for key in REQUIRED_DOCKER_PUPPET_CONFIG_SECTIONS: if key not in puppet_config: print('ERROR: %s is required in puppet_config for %s.' % (key, filename)) @@ -211,8 +217,10 @@ def validate(filename): % filename) return 1 + # qdr aliases rabbitmq service to provide alternative messaging backend if (filename.startswith('./puppet/services/') and - filename != './puppet/services/services.yaml'): + filename not in ['./puppet/services/services.yaml', + './puppet/services/qdr.yaml']): retval = validate_service(filename, tpl) if (filename.startswith('./docker/services/') and