mirror of
https://github.com/ansible/awx.git
synced 2026-01-09 23:12:08 -03:30
Fix empty standard out behavior
Previously we could just check for the absence of the stdout file to know we didn't yet/wouldn't ever have any stdout content. Now that we are creating the stdout file ahead of time and persisting it we need to also check to see if the file contains any data. This is also necessary for some unit tests.
This commit is contained in:
parent
3a61896cb5
commit
7e45ee8b55
@ -598,7 +598,7 @@ class UnifiedJob(PolymorphicModel, PasswordFieldsModel, CommonModelNameNotUnique
|
||||
if self.result_stdout_text:
|
||||
return StringIO(self.result_stdout_text)
|
||||
else:
|
||||
if not os.path.exists(self.result_stdout_file):
|
||||
if not os.path.exists(self.result_stdout_file) or os.stat(self.result_stdout_file).st_size < 1:
|
||||
return StringIO(msg['missing' if self.finished else 'pending'])
|
||||
|
||||
# There is a potential timing issue here, because another
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user