Decoupled callback functions from BaseTask Class

--- Removed all callback functions from 'jobs.py' and put them in a new file '/awx/main/tasks/callback.py'
--- Modified Unit tests unit moved
--- Moved 'update_model' from jobs.py to /awx/main/utils/update_model.py
This commit is contained in:
Amol Gautam
2022-01-31 06:04:23 -05:00
parent f8e680867b
commit 443bdc1234
5 changed files with 433 additions and 350 deletions

View File

@@ -411,9 +411,9 @@ class AWXReceptorJob:
streamer='process',
quiet=True,
_input=resultfile,
event_handler=self.task.event_handler,
finished_callback=self.task.finished_callback,
status_handler=self.task.status_handler,
event_handler=self.task.runner_callback.event_handler,
finished_callback=self.task.runner_callback.finished_callback,
status_handler=self.task.runner_callback.status_handler,
**self.runner_params,
)
@@ -458,7 +458,7 @@ class AWXReceptorJob:
if processor_future.done():
return processor_future.result()
if self.task.cancel_callback():
if self.task.runner_callback.cancel_callback():
result = namedtuple('result', ['status', 'rc'])
return result('canceled', 1)