Skip to content

Commit

Permalink
Merge pull request ansible#2917 from AlanCoding/relaunch_sjt
Browse files Browse the repository at this point in the history
Fx bug where some SJs could not be relaunched

Reviewed-by: https://github.com/softwarefactory-project-zuul[bot]
  • Loading branch information
softwarefactory-project-zuul[bot] authored Dec 17, 2018
2 parents 1d6c88b + a3a5c6b commit a131250
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions awx/api/views/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3154,9 +3154,10 @@ def get(self, request, *args, **kwargs):
def post(self, request, *args, **kwargs):
obj = self.get_object()
if obj.is_sliced_job:
if not obj.job_template_id:
jt = obj.job_template
if not jt:
raise ParseError(_('Cannot relaunch slice workflow job orphaned from job template.'))
elif obj.job_template.job_slice_count != obj.workflow_nodes.count():
elif not jt.inventory or min(jt.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()
Expand Down

0 comments on commit a131250

Please sign in to comment.