Inject project into the acl_parameters.
We want parameters to be free-form, but all of them are always for
a project and we always know the project, so I think it's a sensible
thing to always have available.
Change-Id: Id3d963d78b6a734771af0047dd7b260aa8ecb60b
Reviewed-on: https://review.openstack.org/23952
Reviewed-by: Anita Kuno <akuno@lavabit.com>
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Approved: James E. Blair <corvus@inaugust.com>
Reviewed-by: James E. Blair <corvus@inaugust.com>
Tested-by: Jenkins
diff --git a/jeepyb/cmd/manage_projects.py b/jeepyb/cmd/manage_projects.py
index 6ba4f45..2137ea0 100644
--- a/jeepyb/cmd/manage_projects.py
+++ b/jeepyb/cmd/manage_projects.py
@@ -41,7 +41,7 @@
# acl-append:
# - /path/to/gerrit/project.config
# acl-parameters:
-# super-project: OTHER_PROJECT_NAME
+# project: OTHER_PROJECT_NAME
import ConfigParser
@@ -103,9 +103,12 @@
os.makedirs(repo_base)
if not os.path.isdir(repo_base):
return 1
- config_file = os.path.join(repo_base, "%s.config" % project_parts[-1])
+ project = project_parts[-1]
+ config_file = os.path.join(repo_base, "%s.config" % project)
else:
config_file = os.path.join(acl_dir, "%s.config" % project)
+ if 'project' not in parameters:
+ parameters['project'] = project
with open(config_file, 'w') as config:
if acl_base and os.path.exists(acl_base):
config.write(open(acl_base, 'r').read())