From e21f6f11f87adb118b0c8a81a7b143bff376eb5f Mon Sep 17 00:00:00 2001 From: Owen McGonagle Date: Wed, 27 Jan 2021 13:17:57 -0500 Subject: [PATCH] Add an error message when groups is not found in the playbook If there are no groups in the playbook, we currently get a python error when running command 'openstack tripleo validator group info' Change-Id: Ice089c33d566e90bea55e18fe7f77f9d33fe81f3 --- validations_libs/utils.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/validations_libs/utils.py b/validations_libs/utils.py index 76a494f0..0d45188d 100644 --- a/validations_libs/utils.py +++ b/validations_libs/utils.py @@ -88,6 +88,10 @@ def parse_all_validations_on_disk(path, groups=None): for pl in validations_abspath: val = Validation(pl) + if not val.groups: + msg = 'Group not found in playbook - please add appropriate group' + raise RuntimeError(msg) + if not groups or set(groups).intersection(val.groups): results.append(val.get_metadata) return results