Browse Source

Merge "Add yaml validations for FFU."

changes/19/537719/1
Zuul 4 years ago
committed by Gerrit Code Review
parent
commit
01331f1328
  1. 11
      tools/yaml-validate.py

11
tools/yaml-validate.py

@ -44,6 +44,7 @@ OPTIONAL_SECTIONS = ['workflow_tasks', 'cellv2_discovery']
REQUIRED_DOCKER_SECTIONS = ['service_name', 'docker_config', 'puppet_config',
'config_settings']
OPTIONAL_DOCKER_SECTIONS = ['docker_puppet_tasks', 'upgrade_tasks',
'fast_forward_upgrade_tasks',
'post_upgrade_tasks', 'update_tasks',
'service_config_settings', 'host_prep_tasks',
'metadata_settings', 'kolla_config',
@ -510,6 +511,11 @@ def validate_docker_service(filename, tpl):
print('ERROR: upgrade_tasks validation failed')
return 1
if 'fast_forward_upgrade_tasks' in role_data and role_data['fast_forward_upgrade_tasks']:
if validate_upgrade_tasks(role_data['fast_forward_upgrade_tasks']):
print('ERROR: fast_forward_upgrade_tasks validation failed')
return 1
if 'parameters' in tpl:
for param in required_params:
if param not in tpl['parameters']:
@ -562,6 +568,11 @@ def validate_service(filename, tpl):
print('ERROR: upgrade_tasks validation failed')
return 1
if 'fast_forward_upgrade_tasks' in role_data and role_data['fast_forward_upgrade_tasks']:
if validate_upgrade_tasks(role_data['fast_forward_upgrade_tasks']):
print('ERROR: fast_forward_upgrade_tasks validation failed')
return 1
if 'parameters' in tpl:
for param in required_params:
if param not in tpl['parameters']:

Loading…
Cancel
Save