From 921a58456b3e56e46270c79f138c114e65f92a8c Mon Sep 17 00:00:00 2001 From: Dan Callaghan Date: Jun 27 2018 06:45:56 +0000 Subject: fix DIST_GIT_URL_TEMPLATE default value While testing the RemoteRule feature I noticed the default value in our config does not match the URL structure that Pagure actually serves. Also adjusted DIST_GIT_BASE_URL to always have a trailing slash, to match all the other similar config settings. --- diff --git a/greenwave/config.py b/greenwave/config.py index 8aa1613..4a31187 100644 --- a/greenwave/config.py +++ b/greenwave/config.py @@ -23,8 +23,8 @@ class Config(object): BODHI_URL = 'https://bodhi.fedoraproject.org/' # Options for outbound HTTP requests made by python-requests - DIST_GIT_BASE_URL = 'https://src.fedoraproject.org' - DIST_GIT_URL_TEMPLATE = '{DIST_GIT_BASE_URL}/{pkg_name}/{rev}/gating.yaml' + DIST_GIT_BASE_URL = 'https://src.fedoraproject.org/' + DIST_GIT_URL_TEMPLATE = '{DIST_GIT_BASE_URL}rpms/{pkg_name}/raw/{rev}/f/gating.yaml' KOJI_BASE_URL = 'https://koji.fedoraproject.org/kojihub' REQUESTS_TIMEOUT = (6.1, 15) REQUESTS_VERIFY = True diff --git a/greenwave/resources.py b/greenwave/resources.py index fd12abb..0d4e894 100644 --- a/greenwave/resources.py +++ b/greenwave/resources.py @@ -48,7 +48,7 @@ def retrieve_rev_from_koji(nvr): def retrieve_yaml_remote_rule(rev, pkg_name): """ Retrieve cached gating.yaml content for a given rev. """ data = { - "DIST_GIT_BASE_URL": current_app.config['DIST_GIT_BASE_URL'], + "DIST_GIT_BASE_URL": current_app.config['DIST_GIT_BASE_URL'].rstrip('/') + '/', "pkg_name": pkg_name, "rev": rev }