From 72134198cb5907fc88742a6561ce40672656d567 Mon Sep 17 00:00:00 2001 From: Veronika Fisarova Date: Tue, 11 Apr 2023 17:00:07 +0200 Subject: [PATCH] No validation found exception is raised when group or category or product is defined When executing validations by group or category or product, no validations execute and the message 'No validations found is displayed'. The condition has been updated, so the exception is raised properly. Resolves: rhbz#2185881 Signed-off-by: Veronika Fisarova Change-Id: Icc1d4b83774c6374743f42d22970acea7f2eeb9c --- validations_libs/validation_actions.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/validations_libs/validation_actions.py b/validations_libs/validation_actions.py index 38be961f..c20e8697 100644 --- a/validations_libs/validation_actions.py +++ b/validations_libs/validation_actions.py @@ -525,6 +525,10 @@ class ValidationActions: validations_dir = (validations_dir if validations_dir else self.validation_path) group_playbooks = [] + + if not any((validation_name, group, category, product)): + raise ValidationRunException("No validations found") + if group or category or product: self.log.debug( "Getting the validations list by:\n" @@ -571,9 +575,6 @@ class ValidationActions: playbooks.extend(validation_playbooks) playbooks = list(set(playbooks)) - else: - raise ValidationRunException("No validations found") - log_path = v_utils.create_log_dir(self.log_path) self.log.debug((