Merge "Move RabbitMQ settings out of controller.yaml"
[apex-tripleo-heat-templates.git] / tools / yaml-validate.py
index 34219ef..d75aeb4 100755 (executable)
@@ -33,11 +33,19 @@ def validate_service(filename, tpl):
             print('ERROR: service_name is required in role_data for %s.'
                   % filename)
             return 1
+        # service_name must match the filename, but with an underscore
         if (role_data['service_name'] !=
-                os.path.basename(filename).split('.')[0]):
+                os.path.basename(filename).split('.')[0].replace("-", "_")):
             print('ERROR: service_name should match file name for service: %s.'
                   % 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.'
+                      % (param, filename))
+                return 1
     return 0