Merge "[Validator Show] Properly throwing an exception for unknown validation" into stable/ussuri

This commit is contained in:
Zuul 2021-01-07 19:32:22 +00:00 committed by Gerrit Code Review
commit 1c8c80644e
1 changed files with 6 additions and 4 deletions

View File

@ -93,13 +93,15 @@ class TripleOValidatorShow(command.ShowOne):
def take_action(self, parsed_args):
LOG.debug(_('Show validation result'))
actions = ValidationActions(constants.ANSIBLE_VALIDATION_DIR)
try:
actions = ValidationActions(constants.ANSIBLE_VALIDATION_DIR)
data = actions.show_validations(parsed_args.validation_id)
return data.keys(), data.values()
except Exception as e:
raise RuntimeError(_("Validations listing finished with errors\n"
"Output: {}").format(e))
raise exceptions.CommandError(e)
if data:
return data.keys(), data.values()
class TripleOValidatorShowParameter(command.Command):