fix the sliced job relaunch

This commit is contained in:
Nikhil Jain 2020-02-06 19:01:43 +05:30 committed by Ryan Petrello
parent 7b4adfcc15
commit e530adde67
No known key found for this signature in database
GPG Key ID: F2AA5F2122351777

View File

@ -3265,7 +3265,7 @@ class WorkflowJobRelaunch(GenericAPIView):
jt = obj.job_template
if not jt:
raise ParseError(_('Cannot relaunch slice workflow job orphaned from job template.'))
elif not jt.inventory or min(jt.inventory.hosts.count(), jt.job_slice_count) != obj.workflow_nodes.count():
elif not obj.inventory or min(obj.inventory.hosts.count(), jt.job_slice_count) != obj.workflow_nodes.count():
raise ParseError(_('Cannot relaunch sliced workflow job after slice count has changed.'))
new_workflow_job = obj.create_relaunch_workflow_job()
new_workflow_job.signal_start()