Correct create-cgitrepos projects.yaml versioning
* jeepyb/cmd/create_cgitrepos.py: For backwards compatibility, the
number of YAML documents in the YAML file tells us where to look.
Just always use the last one.
Change-Id: Iffb0a88273dee0abc42664a891ca8ef28a9fc7fb
diff --git a/jeepyb/cmd/create_cgitrepos.py b/jeepyb/cmd/create_cgitrepos.py
index 0234c46..1572a44 100644
--- a/jeepyb/cmd/create_cgitrepos.py
+++ b/jeepyb/cmd/create_cgitrepos.py
@@ -27,8 +27,6 @@
PROJECTS_YAML = os.environ.get('PROJECTS_YAML',
'/home/cgit/projects.yaml')
-PROJECTS_INI = os.environ.get('PROJECTS_INI',
- '/home/gerrit2/projects.ini')
CGIT_REPOS = os.environ.get('CGIT_REPOS',
'/etc/cgitrepos')
REPO_PATH = os.environ.get('REPO_PATH',
@@ -42,10 +40,7 @@
def main():
yaml_docs = [config for config in yaml.safe_load_all(open(PROJECTS_YAML))]
- if os.path.exists(PROJECTS_INI):
- config = yaml_docs[0]
- else:
- config = yaml_docs[1]
+ config = yaml_docs[-1]
gitorgs = {}
names = set()
for entry in config: