aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2017-04-19 10:05:38 +0000
committerGerrit Code Review <review@openstack.org>2017-04-19 10:05:38 +0000
commit1ecf50207bbc15005c590b0e7cd3e0266e60c94b (patch)
tree6713b7ea7742c117f24df87ef029a7bdd502af6b
parent8137335445af0aa2565fda390ef04c54d5db1756 (diff)
parent25fe4bf746df24ac912423e677e1b48bbfa2c7b7 (diff)
Merge "Rework DOCKER_PUPPET_CONFIG validate tool"
-rwxr-xr-xtools/yaml-validate.py18
1 files changed, 11 insertions, 7 deletions
diff --git a/tools/yaml-validate.py b/tools/yaml-validate.py
index 5669a8af..f9dffef0 100755
--- a/tools/yaml-validate.py
+++ b/tools/yaml-validate.py
@@ -28,8 +28,9 @@ REQUIRED_DOCKER_SECTIONS = ['service_name', 'docker_config', 'puppet_config',
OPTIONAL_DOCKER_SECTIONS = ['docker_puppet_tasks', 'upgrade_tasks',
'service_config_settings', 'host_prep_tasks',
'metadata_settings', 'kolla_config']
-DOCKER_PUPPET_CONFIG_SECTIONS = ['config_volume', 'puppet_tags', 'step_config',
- 'config_image']
+REQUIRED_DOCKER_PUPPET_CONFIG_SECTIONS = ['config_volume', 'step_config',
+ 'config_image']
+OPTIONAL_DOCKER_PUPPET_CONFIG_SECTIONS = [ 'puppet_tags' ]
def exit_usage():
@@ -146,13 +147,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))