Browse Source

Merge "Expansion of logging for the list action"

changes/93/795093/8
Zuul 5 days ago
committed by Gerrit Code Review
parent
commit
84fe505f26
2 changed files with 13 additions and 0 deletions
  1. +8
    -0
      validations_libs/utils.py
  2. +5
    -0
      validations_libs/validation_actions.py

+ 8
- 0
validations_libs/utils.py View File

@ -109,6 +109,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 = []
@ -117,6 +118,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)


+ 5
- 0
validations_libs/validation_actions.py 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]


Loading…
Cancel
Save