From 9e88375fecf733bf218e631970d8034cfdade8b1 Mon Sep 17 00:00:00 2001 From: Pierre Tardy Date: Sat, 6 Jan 2018 13:37:07 +0100 Subject: [PATCH 1/2] git: Setup retry by default Lets be reliable by default --- buildbot_travis/vcs/git.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/buildbot_travis/vcs/git.py b/buildbot_travis/vcs/git.py index 9871e36..5c05bc8 100644 --- a/buildbot_travis/vcs/git.py +++ b/buildbot_travis/vcs/git.py @@ -46,6 +46,7 @@ class GitBase(VCSBase): method = "clone" mode = "incremental" retryFetch = True + retry = (2, 10) # default retry 10 times, with 2 seconds delay def addRepository(self, factory, project=None, repository=None, branches=None, **kwargs): kwargs.update(dict( @@ -57,7 +58,8 @@ def addRepository(self, factory, project=None, repository=None, branches=None, * shallow=self.shallow, mode=self.mode, method=self.method, - retryFetch=self.retryFetch + retryFetch=self.retryFetch, + retry=self.retry )) factory.addStep(self.GitStep(**kwargs)) From 35064e99b86df37c7a6c63d8343389762be92a70 Mon Sep 17 00:00:00 2001 From: Pierre Tardy Date: Sat, 6 Jan 2018 13:37:23 +0100 Subject: [PATCH 2/2] flake8 --- buildbot_travis/api.py | 2 +- buildbot_travis/vcs/git.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/buildbot_travis/api.py b/buildbot_travis/api.py index d4d1fd4..5e00779 100644 --- a/buildbot_travis/api.py +++ b/buildbot_travis/api.py @@ -106,7 +106,7 @@ def saveConfig(self, request): if cfg != self._cfg: try: err = yield self.saveCfg(cfg) - except Exception as e: # noqa + except Exception as e: # noqa err = [repr(e)] if err is not None: self._in_progress = False diff --git a/buildbot_travis/vcs/git.py b/buildbot_travis/vcs/git.py index 5c05bc8..e601f95 100644 --- a/buildbot_travis/vcs/git.py +++ b/buildbot_travis/vcs/git.py @@ -17,10 +17,10 @@ from __future__ import print_function from future.moves.urllib.parse import urlparse -from buildbot.plugins import changes, util +from buildbot.plugins import changes from buildbot.steps.source.git import Git -from .base import PollerMixin, VCSBase, getCodebaseForRepository +from .base import PollerMixin, VCSBase class ParsedGitUrl(object):