mirror of
https://github.com/ansible/awx.git
synced 2026-03-20 10:27:34 -02:30
Merge pull request #1192 from chrismeyersfsu/fix-stdout_handler_undefined
more gracefully account for undefined stdout
This commit is contained in:
@@ -993,9 +993,10 @@ class BaseTask(LogErrorsTask):
|
|||||||
logger.exception('%s Exception occurred while running task', instance.log_format)
|
logger.exception('%s Exception occurred while running task', instance.log_format)
|
||||||
finally:
|
finally:
|
||||||
try:
|
try:
|
||||||
stdout_handle.flush()
|
if stdout_handle:
|
||||||
stdout_handle.close()
|
stdout_handle.flush()
|
||||||
event_ct = getattr(stdout_handle, '_event_ct', 0)
|
stdout_handle.close()
|
||||||
|
event_ct = getattr(stdout_handle, '_event_ct', 0)
|
||||||
logger.info('%s finished running, producing %s events.',
|
logger.info('%s finished running, producing %s events.',
|
||||||
instance.log_format, event_ct)
|
instance.log_format, event_ct)
|
||||||
except Exception:
|
except Exception:
|
||||||
|
|||||||
Reference in New Issue
Block a user