mirror of
https://github.com/ansible/awx.git
synced 2026-03-07 03:31:10 -03:30
Resolve can_start from the client side and the signaler side
This commit is contained in:
@@ -237,6 +237,7 @@ def process_graph(graph, task_capacity):
|
|||||||
if not start_status:
|
if not start_status:
|
||||||
node_obj.status = 'failed'
|
node_obj.status = 'failed'
|
||||||
node_obj.result_traceback += "Task failed pre-start check"
|
node_obj.result_traceback += "Task failed pre-start check"
|
||||||
|
node_obj.save()
|
||||||
# TODO: Run error handler
|
# TODO: Run error handler
|
||||||
continue
|
continue
|
||||||
remaining_volume -= impact
|
remaining_volume -= impact
|
||||||
|
|||||||
@@ -370,7 +370,7 @@ class CommonTask(PrimordialModel):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def can_start(self):
|
def can_start(self):
|
||||||
return bool(self.status == 'new')
|
return bool(self.status in ('new', 'waiting'))
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def task_impact(self):
|
def task_impact(self):
|
||||||
@@ -397,7 +397,7 @@ class CommonTask(PrimordialModel):
|
|||||||
|
|
||||||
def start(self, error_callback, **kwargs):
|
def start(self, error_callback, **kwargs):
|
||||||
task_class = self._get_task_class()
|
task_class = self._get_task_class()
|
||||||
if not self.can_start:
|
if not self.status == 'waiting':
|
||||||
return False
|
return False
|
||||||
needed = self._get_passwords_needed_to_start()
|
needed = self._get_passwords_needed_to_start()
|
||||||
try:
|
try:
|
||||||
|
|||||||
Reference in New Issue
Block a user