Allow to customize values in .gitreview file

There might be situation when project creation can be done from
other "endpoint" then common users have access. So we need to have
an ability to customise GERRIT_HOST and GERRIT_PORT parameters
inside .gitreview file for newly created project.

This change adds two parameters, that can be re-defined in
projects.ini file to format correct connection string to gerrit:
  * GITREVIEW_GERRIT_HOST (by default = GERRIT_HOST)
  * GITREVIEW_GERRIT_PORT (by default = GERRIT_PORT)

Change-Id: Ie3fc35c5b6714c579314faa18160594aeae79cb7
This commit is contained in:
Sergey Kulanov 2016-12-13 12:16:26 +02:00
parent 6d1ba2f169
commit d9dc2e264a
1 changed files with 6 additions and 2 deletions

View File

@ -618,7 +618,11 @@ def main():
'/var/lib/jeepyb')
ACL_DIR = registry.get_defaults('acl-dir')
GERRIT_HOST = registry.get_defaults('gerrit-host')
GITREVIEW_GERRIT_HOST = registry.get_defaults(
'gitreview-gerrit-host', GERRIT_HOST)
GERRIT_PORT = int(registry.get_defaults('gerrit-port', '29418'))
GITREVIEW_GERRIT_PORT = int(registry.get_defaults(
'gitreview-gerrit-port', GERRIT_PORT))
GERRIT_USER = registry.get_defaults('gerrit-user')
GERRIT_KEY = registry.get_defaults('gerrit-key')
GERRIT_GITID = registry.get_defaults('gerrit-committer')
@ -710,8 +714,8 @@ def main():
# Make Local repo
push_string = make_local_copy(
repo_path, project, project_list,
git_opts, ssh_env, upstream, GERRIT_HOST,
GERRIT_PORT, project_git, GERRIT_GITID)
git_opts, ssh_env, upstream, GITREVIEW_GERRIT_HOST,
GITREVIEW_GERRIT_PORT, project_git, GERRIT_GITID)
description = (
find_description_override(repo_path)