Make Gerrit system user and group configurable
The gerrit2 system user and group was hardcoded in manage_projects. This simply allows the values to be overridden by options 'gerrit-system-user' and 'gerrit-system-group' in the defaults section of the projects.yml file. fixes lp 1191542 Change-Id: Ieb736e08a6f96c10abfabe8b17808681732cb8b6 Reviewed-on: https://review.openstack.org/33196 Reviewed-by: Monty Taylor <mordred@inaugust.com> Reviewed-by: James E. Blair <corvus@inaugust.com> Reviewed-by: Jeremy Stanley <fungi@yuggoth.org> Approved: Clark Boylan <clark.boylan@gmail.com> Reviewed-by: Clark Boylan <clark.boylan@gmail.com> Tested-by: Jenkins
This commit is contained in:
parent
1faf327cfb
commit
2f13d563c2
@ -299,6 +299,8 @@ def main():
|
||||
GERRIT_USER = defaults.get('gerrit-user')
|
||||
GERRIT_KEY = defaults.get('gerrit-key')
|
||||
GERRIT_GITID = defaults.get('gerrit-committer')
|
||||
GERRIT_SYSTEM_USER = defaults.get('gerrit-system-user', 'gerrit2')
|
||||
GERRIT_SYSTEM_GROUP = defaults.get('gerrit-system-group', 'gerrit2')
|
||||
|
||||
gerrit = gerritlib.gerrit.Gerrit('localhost',
|
||||
GERRIT_USER,
|
||||
@ -355,8 +357,9 @@ project=%s
|
||||
|
||||
if not os.path.exists(project_dir):
|
||||
run_command("git --bare init %s" % project_dir)
|
||||
run_command("chown -R gerrit2:gerrit2 %s"
|
||||
% project_dir)
|
||||
run_command("chown -R %s:%s %s"
|
||||
% (GERRIT_SYSTEM_USER, GERRIT_SYSTEM_GROUP,
|
||||
project_dir))
|
||||
|
||||
git_command(repo_path,
|
||||
push_string % remote_url,
|
||||
|
Loading…
x
Reference in New Issue
Block a user