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
This commit is contained in:
parent
528c44b4e7
commit
e21f6f11f8
@ -88,6 +88,10 @@ def parse_all_validations_on_disk(path, groups=None):
|
|||||||
|
|
||||||
for pl in validations_abspath:
|
for pl in validations_abspath:
|
||||||
val = Validation(pl)
|
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):
|
if not groups or set(groups).intersection(val.groups):
|
||||||
results.append(val.get_metadata)
|
results.append(val.get_metadata)
|
||||||
return results
|
return results
|
||||||
|
Loading…
x
Reference in New Issue
Block a user