From c06649ba8800d3df6a95b510f0ee2ccb5760363a Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Aug 10 2016 10:03:23 +0000 Subject: Use urlparse.urljoin to build the final url to call --- diff --git a/pagure-ci/pagure_ci_server.py b/pagure-ci/pagure_ci_server.py index d2bfe62..8ed72eb 100644 --- a/pagure-ci/pagure_ci_server.py +++ b/pagure-ci/pagure_ci_server.py @@ -24,6 +24,7 @@ import logging import os import requests import time +import urlparse import uuid import six @@ -95,11 +96,9 @@ def handle_messages(): project.fullname, pr_id, repo, branch) url = project.ci_hook[0].ci_url - if url.endswith('/'): - url = url[:-1] if data['ci_type'] == 'jenkins': - url += '/buildWithParameters' + url = urlparse.urljoin(url, '/buildWithParameters') log.info('Triggering the build at: %s', url) requests.post( url,