diff --git a/playbooks/roles/gitea-git-repos/library/gitea_create_repos.py b/playbooks/roles/gitea-git-repos/library/gitea_create_repos.py index 3936a442bc..fd5b697452 100755 --- a/playbooks/roles/gitea-git-repos/library/gitea_create_repos.py +++ b/playbooks/roles/gitea-git-repos/library/gitea_create_repos.py @@ -210,12 +210,19 @@ class Gitea(object): description_update = { 'description': description, } - resp = self.patch( - '/api/v1/repos/{org}/{repo}'.format(org=org, repo=repo), - json=description_update) - # Commented out as there is no good way to log only those projects - # which have an updated description and as a result this is noisy. - #self.log("Set description for:", project['project']) + try: + resp = self.patch( + '/api/v1/repos/{org}/{repo}'.format(org=org, repo=repo), + json=description_update) + # Commented out as there is no good way to log only those + # projects which have an updated description and as a result + # this is noisy. + #self.log("Set description for:", project['project']) + except Exception as e: + # Updating descriptions is best effort as we may fail due to + # gitea bugs, but such a failure isn't critical. + self.log("Failed to set desciption for:", + project['project'], str(e)) def make_projects(self, projects, gitea_repos, csrf_token, settings_thread_pool, branches_thread_pool, futures):