Add yaml validations for FFU.

A new set of tasks are being added,
the 'fast_forward_upgrade_tasks', which
share structure with 'upgrade_tasks' hence
the same set of validations are being applied
to check the correct tasks structure.

Change-Id: I26898e2df68d80d0721e0467c5220f34835f6ba4
This commit is contained in:
Jose Luis Franco Arza 2018-01-17 10:10:35 +01:00
parent 2ebc2ee3af
commit 39b7b930ba
1 changed files with 11 additions and 0 deletions

View File

@ -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']: