mirror of
https://github.com/ansible/awx.git
synced 2026-04-10 20:49:24 -02:30
Make sure we cleanup task output files when delete() is called on CommonTask models
This commit is contained in:
@@ -4,6 +4,7 @@
|
|||||||
# Python
|
# Python
|
||||||
import json
|
import json
|
||||||
import shlex
|
import shlex
|
||||||
|
import os
|
||||||
import os.path
|
import os.path
|
||||||
|
|
||||||
# PyYAML
|
# PyYAML
|
||||||
@@ -327,6 +328,14 @@ class CommonTask(PrimordialModel):
|
|||||||
if self.status != status_before:
|
if self.status != status_before:
|
||||||
self._update_parent_instance()
|
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
|
@property
|
||||||
def result_stdout(self):
|
def result_stdout(self):
|
||||||
if self.result_stdout_file != "":
|
if self.result_stdout_file != "":
|
||||||
|
|||||||
Reference in New Issue
Block a user