Make local git dir creation optional
manage-projects unconditionally set up a local git dir even if the
config option was unset. We change that behavior because new gerrit url
paths make a local git dir option less straight forward. If you've set a
git dir path we'll continue to honor it, otherwise this step is skipped.
Depends-On: https://review.opendev.org/762196
Change-Id: I39ef5ba7cd8747d52487cb0252a9b12878d6247b
diff --git a/jeepyb/cmd/manage_projects.py b/jeepyb/cmd/manage_projects.py
index 4b29e56..c818841 100644
--- a/jeepyb/cmd/manage_projects.py
+++ b/jeepyb/cmd/manage_projects.py
@@ -431,7 +431,7 @@
default_has_github = registry.get_defaults('has-github', True)
- LOCAL_GIT_DIR = registry.get_defaults('local-git-dir', '/var/lib/git')
+ LOCAL_GIT_DIR = registry.get_defaults('local-git-dir', None)
JEEPYB_CACHE_DIR = registry.get_defaults('jeepyb-cache-dir',
'/var/lib/jeepyb')
ACL_DIR = registry.get_defaults('acl-dir')
@@ -550,9 +550,12 @@
gerrit.replicate(project)
# Create the repo for the local git mirror
- create_local_mirror(
- LOCAL_GIT_DIR, project_git,
- GERRIT_OS_SYSTEM_USER, GERRIT_OS_SYSTEM_GROUP)
+ if LOCAL_GIT_DIR:
+ # This is conditional because new gerrit url pathing
+ # has made local git mirrors less straightfoward.
+ create_local_mirror(
+ LOCAL_GIT_DIR, project_git,
+ GERRIT_OS_SYSTEM_USER, GERRIT_OS_SYSTEM_GROUP)
if acl_config:
acl_sha = acl_cache.get(acl_config)