Expansion of logging for the run action.

Logging statements related to the run action
in validation_actions.py were expanded.

New debug level logging statements introduced.

One of the testing constants in the fakes.py was altered
as it was not accurate representation of real data,
and as such was breaking the new logging statements
during unit test runs.

Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Change-Id: Ic308a76f4f6af6e7fe64930e84360bfb4ed587be
This commit is contained in:
Jiri Podivin 2021-05-12 15:09:35 +02:00
parent 85947ee8e0
commit 8830c69e48
2 changed files with 16 additions and 5 deletions

View File

@ -43,9 +43,9 @@ VALIDATION_LIST_RESULT = (('ID', 'Name', 'Groups'),
['prep', 'pre-introspection'])])
GROUPS_LIST = [
('group1', 'Group1 description'),
('group2', 'Group2 description'),
('group3', 'Group3 description'),
'group1',
'group2',
'group3'
]
BAD_VALIDATIONS_LOGS_CONTENTS_LIST = [{

View File

@ -332,7 +332,9 @@ class ValidationActions(object):
validations_dir = (validations_dir if validations_dir
else self.validation_path)
if group:
self.log.debug('Getting the validations list by group')
self.log.debug(
'Getting the validations from groups {}'.format(
','.join(group)))
try:
validations = v_utils.parse_all_validations_on_disk(
validations_dir, group)
@ -341,6 +343,10 @@ class ValidationActions(object):
except Exception as e:
raise(e)
elif validation_name:
self.log.debug(
"Getting the {} validation.".format(
validation_name))
validation_name = v_utils.convert_data(validation_name)
playbooks = v_utils.get_validations_playbook(validations_dir,
@ -362,7 +368,12 @@ class ValidationActions(object):
raise RuntimeError("No validations found")
log_path = v_utils.create_log_dir(log_path)
self.log.debug('Running the validations with Ansible')
self.log.debug((
'Running the validations with Ansible.\n'
'Gathered playbooks:\n -{}').format(
'\n -'.join(playbooks)))
results = []
for playbook in playbooks:
# Check if playbook should be skipped and on which hosts