Expansion of logging for the list action

Two new logging calls for the list action on the
info and debbug level.

Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Change-Id: I56044c93b03531159953c323f8e530d833819a5f
This commit is contained in:
Jiri Podivin 2021-05-12 10:01:53 +02:00
parent eaf304f62e
commit 91c17107c5
2 changed files with 13 additions and 0 deletions

View File

@ -83,6 +83,7 @@ def parse_all_validations_on_disk(path, groups=None):
'id': 'check-cpu',
'name': 'Verify if the server fits the CPU core requirements'}]
"""
results = []
if not groups:
groups = []
@ -91,6 +92,13 @@ def parse_all_validations_on_disk(path, groups=None):
validations_abspath = glob.glob("{path}/*.yaml".format(path=path))
LOG.debug(
"Attempting to parse validations of groups `{}` from {}".format(
','.join(groups),
validations_abspath
)
)
for playbook in validations_abspath:
val = Validation(playbook)

View File

@ -78,9 +78,14 @@ class ValidationActions(object):
('validation2', 'Name of the validation2', ['group1', 'group2'])])
"""
self.log = logging.getLogger(__name__ + ".list_validations")
validations = v_utils.parse_all_validations_on_disk(
self.validation_path, group)
self.log.debug(
"Parsed {} validations.".format(len(validations))
)
return_values = [
(val.get('id'), val.get('name'), val.get('groups'))
for val in validations]