aboutsummaryrefslogtreecommitdiffstats
path: root/tools/yaml-validate.py
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2016-08-31 16:13:14 +0000
committerGerrit Code Review <review@openstack.org>2016-08-31 16:13:14 +0000
commite774cb35d5a0658de7595839b0c54c4181181798 (patch)
tree3131a2247745bae3366ec2eeb8ee24e2c2901a13 /tools/yaml-validate.py
parent1c0df5b42ab17be8a8d256247c77999acb5eecc7 (diff)
parentdd0511494492aea65cd0f48d93403c283be46cbe (diff)
Merge "Skip warning for required parameters"
Diffstat (limited to 'tools/yaml-validate.py')
-rwxr-xr-xtools/yaml-validate.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/yaml-validate.py b/tools/yaml-validate.py
index d75aeb4f..7b3d3473 100755
--- a/tools/yaml-validate.py
+++ b/tools/yaml-validate.py
@@ -17,6 +17,8 @@ import traceback
import yaml
+required_params = ['EndpointMap', 'ServiceNetMap', 'DefaultPasswords']
+
def exit_usage():
print('Usage %s <yaml file or directory>' % sys.argv[0])
sys.exit(1)
@@ -40,7 +42,6 @@ def validate_service(filename, tpl):
% filename)
return 1
if 'parameters' in tpl:
- required_params = ['EndpointMap', 'ServiceNetMap', 'DefaultPasswords']
for param in required_params:
if param not in tpl['parameters']:
print('ERROR: parameter %s is required for %s.'
@@ -64,6 +65,8 @@ def validate(filename):
return 1
# yaml is OK, now walk the parameters and output a warning for unused ones
for p in tpl.get('parameters', {}):
+ if p in required_params:
+ continue
str_p = '\'%s\'' % p
in_resources = str_p in str(tpl.get('resources', {}))
in_outputs = str_p in str(tpl.get('outputs', {}))