build-test-packages: Fix gerrit based dependency parsing

The repo cloning part of the role was altered to not assume the
'https://' URL prefix. This broke the repo cloning in certain situations
(when only hostname was given). This change restores the original
behavior and assumes a https:// prefix for all gerrit instances.

Change-Id: Ib0606f3676a3ee7454201a80edde29c47f50b666
Closes-bug: #1690899
This commit is contained in:
Attila Darazs 2017-05-16 12:42:57 +02:00
parent 4d0f6329df
commit 0815e66bab
2 changed files with 9 additions and 0 deletions

View File

@ -191,6 +191,12 @@ def resolve_dep(host, change_id, branch, revision):
continue
new_deps = parse_commit_msg(change['host'], details['commit_msg'])
to_resolve.extend(new_deps)
for index in range(len(deps)):
if deps[index]['host'] == 'review.openstack.org':
# redirect change cloning to reduce load on review.openstack.org
deps[index]['host'] = 'git.openstack.org'
# add https:// prefix for cloning the change
deps[index]['host'] = ''.join(['https://', deps[index]['host']])
if len(deps) == 0:
output_msg.append('error: failed to resolve the target change')
return {'failed': True,

View File

@ -54,6 +54,9 @@ def process(host, changes, branch):
# https://bugs.launchpad.net/tripleo/+bug/1676853
if '.openstack.org' in host:
host = 'https://git.openstack.org'
# add URL prefix if only the bare hostname is given
if host.find('://') == -1:
host = ''.join(['https://', host])
output.append({"host": host,
"project": params[0],
"branch": params[1],