Exclude non failing gathering facts action in simplified result

The warnings key while gathering facts is set to an empty list if this
action pass successfully. This patch excludes successful gathering facts
action and grab action logs when some real warnings are present.

Change-Id: I23a81c57774bb6259d071b0c3da3a309fc33986c
Signed-off-by: Gael Chamoulaud (Strider) <gchamoul@redhat.com>
This commit is contained in:
Gael Chamoulaud (Strider) 2020-10-20 14:56:29 +02:00
parent 844b877a68
commit 51f27383c8
No known key found for this signature in database
GPG Key ID: 4119D0305C651D66
1 changed files with 1 additions and 1 deletions

View File

@ -171,7 +171,7 @@ class CallbackModule(CallbackBase):
self.simple_results.append(self._val_task(task.name))
self.simple_results[-1]['task']['status'] = "FAILED"
self.simple_results[-1]['task']['hosts'][host.name] = task_result
if 'warnings' in task_result.keys():
if 'warnings' in task_result.keys() and task_result.get('warnings'):
self.simple_results.append(self._val_task(task.name))
self.simple_results[-1]['task']['status'] = "WARNING"
self.simple_results[-1]['task']['hosts'][host.name] = task_result