mirror of
https://github.com/ansible/awx.git
synced 2026-01-13 11:00:03 -03:30
Delete artifact dir after transmit phase is finished
This commit is contained in:
parent
8fac1c18c8
commit
2609ee5ed0
@ -4,6 +4,8 @@ from collections import namedtuple
|
||||
import concurrent.futures
|
||||
from enum import Enum
|
||||
import logging
|
||||
import os
|
||||
import shutil
|
||||
import socket
|
||||
import sys
|
||||
import threading
|
||||
@ -330,6 +332,12 @@ class AWXReceptorJob:
|
||||
|
||||
transmitter_thread.join()
|
||||
|
||||
# Artifacts are an output, but sometimes they are an input as well
|
||||
# this is the case with fact cache, where clearing facts deletes a file, and this must be captured
|
||||
artifact_dir = os.path.join(self.runner_params['private_data_dir'], 'artifacts')
|
||||
if os.path.exists(artifact_dir):
|
||||
shutil.rmtree(artifact_dir)
|
||||
|
||||
resultsock, resultfile = receptor_ctl.get_work_results(self.unit_id, return_socket=True, return_sockfile=True)
|
||||
# Both "processor" and "cancel_watcher" are spawned in separate threads.
|
||||
# We wait for the first one to return. If cancel_watcher returns first,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user