Merge "Track global failures flag for YAML validations"
This commit is contained in:
@@ -831,6 +831,7 @@ def validate(filename, param_map):
|
|||||||
},
|
},
|
||||||
...
|
...
|
||||||
]}
|
]}
|
||||||
|
Returns a global retval that indicates any failures had been in the check progress.
|
||||||
"""
|
"""
|
||||||
if args.quiet < 1:
|
if args.quiet < 1:
|
||||||
print('Validating %s' % filename)
|
print('Validating %s' % filename)
|
||||||
@@ -867,23 +868,23 @@ def validate(filename, param_map):
|
|||||||
if VALIDATE_PUPPET_OVERRIDE.get(filename, False) or (
|
if VALIDATE_PUPPET_OVERRIDE.get(filename, False) or (
|
||||||
filename.startswith('./puppet/services/') and
|
filename.startswith('./puppet/services/') and
|
||||||
VALIDATE_PUPPET_OVERRIDE.get(filename, True)):
|
VALIDATE_PUPPET_OVERRIDE.get(filename, True)):
|
||||||
retval = validate_service(filename, tpl)
|
retval |= validate_service(filename, tpl)
|
||||||
|
|
||||||
if re.search(r'(puppet|docker)\/services', filename):
|
if re.search(r'(puppet|docker)\/services', filename):
|
||||||
retval = validate_service_hiera_interpol(filename, tpl)
|
retval |= validate_service_hiera_interpol(filename, tpl)
|
||||||
|
|
||||||
if filename.startswith('./docker/services/logging/'):
|
if filename.startswith('./docker/services/logging/'):
|
||||||
retval = validate_docker_logging_template(filename, tpl)
|
retval |= validate_docker_logging_template(filename, tpl)
|
||||||
elif VALIDATE_DOCKER_OVERRIDE.get(filename, False) or (
|
elif VALIDATE_DOCKER_OVERRIDE.get(filename, False) or (
|
||||||
filename.startswith('./docker/services/') and
|
filename.startswith('./docker/services/') and
|
||||||
VALIDATE_DOCKER_OVERRIDE.get(filename, True)):
|
VALIDATE_DOCKER_OVERRIDE.get(filename, True)):
|
||||||
retval = validate_docker_service(filename, tpl)
|
retval |= validate_docker_service(filename, tpl)
|
||||||
|
|
||||||
if filename.endswith('hyperconverged-ceph.yaml'):
|
if filename.endswith('hyperconverged-ceph.yaml'):
|
||||||
retval = validate_hci_compute_services_default(filename, tpl)
|
retval |= validate_hci_compute_services_default(filename, tpl)
|
||||||
|
|
||||||
if filename.startswith('./roles/ComputeHCI.yaml'):
|
if filename.startswith('./roles/ComputeHCI.yaml'):
|
||||||
retval = validate_hci_computehci_role(filename, tpl)
|
retval |= validate_hci_computehci_role(filename, tpl)
|
||||||
|
|
||||||
if filename.startswith('./roles/ComputeOvsDpdk.yaml') or \
|
if filename.startswith('./roles/ComputeOvsDpdk.yaml') or \
|
||||||
filename.startswith('./roles/ComputeSriov.yaml') or \
|
filename.startswith('./roles/ComputeSriov.yaml') or \
|
||||||
@@ -896,29 +897,32 @@ def validate(filename, param_map):
|
|||||||
'OS::TripleO::Services::NeutronVppAgent',
|
'OS::TripleO::Services::NeutronVppAgent',
|
||||||
'OS::TripleO::Services::Vpp',
|
'OS::TripleO::Services::Vpp',
|
||||||
'OS::TripleO::Services::NeutronLinuxbridgeAgent']
|
'OS::TripleO::Services::NeutronLinuxbridgeAgent']
|
||||||
retval = validate_with_compute_role_services(filename, tpl, exclude)
|
retval |= validate_with_compute_role_services(filename, tpl, exclude)
|
||||||
|
|
||||||
if filename.startswith('./roles/ComputeRealTime.yaml'):
|
if filename.startswith('./roles/ComputeRealTime.yaml'):
|
||||||
exclude = [
|
exclude = [
|
||||||
'OS::TripleO::Services::Tuned',
|
'OS::TripleO::Services::Tuned',
|
||||||
]
|
]
|
||||||
retval = validate_with_compute_role_services(filename, tpl, exclude)
|
retval |= validate_with_compute_role_services(filename, tpl, exclude)
|
||||||
|
|
||||||
if filename.startswith('./roles/Hci'):
|
if filename.startswith('./roles/Hci'):
|
||||||
retval = validate_hci_role(filename, tpl)
|
retval |= validate_hci_role(filename, tpl)
|
||||||
|
|
||||||
if filename.startswith('./roles/Ceph'):
|
if filename.startswith('./roles/Ceph'):
|
||||||
retval = validate_ceph_role(filename, tpl)
|
retval |= validate_ceph_role(filename, tpl)
|
||||||
|
|
||||||
if filename.startswith('./roles/ControllerNoCeph.yaml'):
|
if filename.startswith('./roles/ControllerNoCeph.yaml'):
|
||||||
retval = validate_controller_no_ceph_role(filename, tpl)
|
retval |= validate_controller_no_ceph_role(filename, tpl)
|
||||||
|
|
||||||
if filename.startswith('./network_data_'):
|
if filename.startswith('./network_data_'):
|
||||||
retval = validate_network_data_file(filename)
|
result = validate_network_data_file(filename)
|
||||||
|
retval |= result
|
||||||
|
else:
|
||||||
|
result = retval
|
||||||
|
|
||||||
if retval == 0 and is_heat_template:
|
if result == 0 and is_heat_template:
|
||||||
# check for old style nic config files
|
# check for old style nic config files
|
||||||
retval = validate_nic_config_file(filename, tpl)
|
retval |= validate_nic_config_file(filename, tpl)
|
||||||
|
|
||||||
except Exception:
|
except Exception:
|
||||||
print(traceback.format_exc())
|
print(traceback.format_exc())
|
||||||
|
Reference in New Issue
Block a user