mirror of
https://github.com/ansible/awx.git
synced 2026-03-09 21:49:27 -02:30
Delete artifact dir after transmit phase is finished
This commit is contained in:
@@ -4,6 +4,8 @@ from collections import namedtuple
|
|||||||
import concurrent.futures
|
import concurrent.futures
|
||||||
from enum import Enum
|
from enum import Enum
|
||||||
import logging
|
import logging
|
||||||
|
import os
|
||||||
|
import shutil
|
||||||
import socket
|
import socket
|
||||||
import sys
|
import sys
|
||||||
import threading
|
import threading
|
||||||
@@ -330,6 +332,12 @@ class AWXReceptorJob:
|
|||||||
|
|
||||||
transmitter_thread.join()
|
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)
|
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.
|
# Both "processor" and "cancel_watcher" are spawned in separate threads.
|
||||||
# We wait for the first one to return. If cancel_watcher returns first,
|
# We wait for the first one to return. If cancel_watcher returns first,
|
||||||
|
|||||||
Reference in New Issue
Block a user