Fix an issue with set_stats for unsupported Ansible versions

This commit is contained in:
Matthew Jones 2017-01-11 10:23:47 -05:00
parent 833c61c8cb
commit 974fe1d244

View File

@ -328,7 +328,7 @@ class BaseCallbackModule(CallbackBase):
ok=stats.ok,
processed=stats.processed,
skipped=stats.skipped,
artifact_data=stats.custom.get('_run', {})
artifact_data=stats.custom.get('_run', {}) if hasattr(stats, 'custom') else {}
)
with self.capture_event_data('playbook_on_stats', **event_data):