mirror of
https://github.com/ansible/awx.git
synced 2026-01-09 15:02:07 -03:30
AAP-14538 Only process ansible_facts for successful jobs (#14313)
This commit is contained in:
parent
abc56305cc
commit
6f9ea1892b
@ -31,6 +31,7 @@ class RunnerCallback:
|
||||
self.model = model
|
||||
self.update_attempts = int(settings.DISPATCHER_DB_DOWNTOWN_TOLLERANCE / 5)
|
||||
self.wrapup_event_dispatched = False
|
||||
self.artifacts_processed = False
|
||||
self.extra_update_fields = {}
|
||||
|
||||
def update_model(self, pk, _attempt=0, **updates):
|
||||
@ -211,6 +212,9 @@ class RunnerCallback:
|
||||
if result_traceback:
|
||||
self.delay_update(result_traceback=result_traceback)
|
||||
|
||||
def artifacts_handler(self, artifact_dir):
|
||||
self.artifacts_processed = True
|
||||
|
||||
|
||||
class RunnerCallbackForProjectUpdate(RunnerCallback):
|
||||
def __init__(self, *args, **kwargs):
|
||||
|
||||
@ -1094,7 +1094,7 @@ class RunJob(SourceControlMixin, BaseTask):
|
||||
# actual `run()` call; this _usually_ means something failed in
|
||||
# the pre_run_hook method
|
||||
return
|
||||
if self.should_use_fact_cache():
|
||||
if self.should_use_fact_cache() and self.runner_callback.artifacts_processed:
|
||||
job.log_lifecycle("finish_job_fact_cache")
|
||||
finish_fact_cache(
|
||||
job.get_hosts_for_fact_cache(),
|
||||
|
||||
@ -464,6 +464,7 @@ class AWXReceptorJob:
|
||||
event_handler=self.task.runner_callback.event_handler,
|
||||
finished_callback=self.task.runner_callback.finished_callback,
|
||||
status_handler=self.task.runner_callback.status_handler,
|
||||
artifacts_handler=self.task.runner_callback.artifacts_handler,
|
||||
**self.runner_params,
|
||||
)
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user