mirror of
https://github.com/ansible/awx.git
synced 2026-01-15 20:00:43 -03:30
Make sure we cleanup task output files when delete() is called on CommonTask models
This commit is contained in:
parent
5fa228c085
commit
27eb4f48b3
@ -4,6 +4,7 @@
|
||||
# Python
|
||||
import json
|
||||
import shlex
|
||||
import os
|
||||
import os.path
|
||||
|
||||
# PyYAML
|
||||
@ -327,6 +328,14 @@ class CommonTask(PrimordialModel):
|
||||
if self.status != status_before:
|
||||
self._update_parent_instance()
|
||||
|
||||
def delete(self):
|
||||
if self.result_stdout_file != "":
|
||||
try:
|
||||
os.remove(self.result_stdout_file)
|
||||
except Exception, e:
|
||||
pass
|
||||
super(CommonTask, self).delete()
|
||||
|
||||
@property
|
||||
def result_stdout(self):
|
||||
if self.result_stdout_file != "":
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user