Browse Source

Merge "[Validator Run] Detect unknown validations from the command-line"

changes/66/759866/1
Zuul 1 year ago
committed by Gerrit Code Review
parent
commit
5d372338f6
  1. 14
      validations_libs/validation_actions.py

14
validations_libs/validation_actions.py

@ -86,9 +86,17 @@ class ValidationActions(object):
playbooks = v_utils.get_validations_playbook(validations_dir,
validation_name,
group)
if not playbooks:
msg = "Validation {} not found in {}.".format(validation_name,
validations_dir)
if not playbooks or len(validation_name) != len(playbooks):
p = []
for play in playbooks:
p.append(os.path.basename(os.path.splitext(play)[0]))
unknown_validation = list(set(validation_name) - set(p))
msg = "Validation {} not found in {}.".format(
unknown_validation, validations_dir)
raise RuntimeError(msg)
else:
raise RuntimeError("No validations found")

Loading…
Cancel
Save