gitlab: skip another race condition in project creation

This commit is contained in:
Loic Dachary 2021-01-28 01:29:10 +01:00
parent 23f3969e75
commit cae5a8f785
No known key found for this signature in database
GPG Key ID: 992D23B392F9E4F2
1 changed files with 4 additions and 1 deletions

View File

@ -90,7 +90,10 @@ class GitLab(object):
r = self.s.post(f'{self.s.api}/projects', data=data)
if r.status_code == 201:
return r.json()
if r.status_code == 400 and 'still being deleted' in r.text:
if r.status_code == 400 and (
'still being deleted' in r.text or
'has already been taken' in r.text
):
raise GitLab.DeletionInProgress()
r.raise_for_status()