From 3027ce2735072bf586860868e9d8196339ff2662 Mon Sep 17 00:00:00 2001 From: Alex Schultz Date: Mon, 23 Nov 2020 15:46:39 -0700 Subject: [PATCH] Add version specific changes for git-url With the upgrade of opendev's gerrit to 3.2.5.1, the git clones are failing because the repository url no longer has p/ in it. This change adds p/ in only if the version is less than 3 when we do a version check. Change-Id: Id05cfa6449c6c36dd59c7efd74d57cebafcb78c6 --- gertty/config.py | 2 +- gertty/sync.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/gertty/config.py b/gertty/config.py index a657105..7d20d70 100644 --- a/gertty/config.py +++ b/gertty/config.py @@ -184,7 +184,7 @@ class Config(object): # And this is to allow Git callouts os.environ['GIT_SSL_CAINFO'] = self.ssl_ca_path self.git_root = os.path.expanduser(server['git-root']) - git_url = server.get('git-url', self.url + 'p/') + git_url = server.get('git-url', self.url) if not git_url.endswith('/'): git_url += '/' self.git_url = git_url diff --git a/gertty/sync.py b/gertty/sync.py index 386aca1..0811024 100644 --- a/gertty/sync.py +++ b/gertty/sync.py @@ -1673,6 +1673,9 @@ class Sync(object): if len(parts) > 2: micro = int(parts[2]) self.version = (major, minor, micro) + if self.version < (3,0,0): + # version 3 doesn't use a /p/ prefix. + self.app.config.git_url = self.app.config.git_url + 'p/' self.log.info("Remote version is: %s (parsed as %s)" % (version, self.version)) def query(self, queries):