Merge pull request #3070 from wwitzel3/release_3.3.1

better error handling when over limit
This commit is contained in:
Wayne Witzel III 2018-10-17 09:09:01 -04:00 committed by GitHub
commit 0b4e0678e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4335,6 +4335,11 @@ class JobRelaunch(RetrieveAPIView):
'Cannot relaunch because previous job had 0 {status_value} hosts.'
).format(status_value=retry_hosts)}, status=status.HTTP_400_BAD_REQUEST)
copy_kwargs['limit'] = ','.join(retry_host_list)
limit_length = len(copy_kwargs['limit'])
if limit_length > 1024:
return Response({'limit': _(
'Cannot relaunch because the limit length {limit_length} exceeds the max of {limit_max}.'
).format(limit_length=limit_lengh, limit_max=1024)}, status=status.HTTP_400_BAD_REQUEST)
new_job = obj.copy_unified_job(**copy_kwargs)
result = new_job.signal_start(**serializer.validated_data['credential_passwords'])