From a54bff964f3450a28bb8347b03acc98573f188bf Mon Sep 17 00:00:00 2001 From: Ralph Bean Date: Thu, 17 Aug 2017 17:19:49 +0000 Subject: [PATCH] Make sure to correctly escape package names, like atari++. --- .../pagure/templates/pagure-sync-bugzilla.py.j2 | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/roles/distgit/pagure/templates/pagure-sync-bugzilla.py.j2 b/roles/distgit/pagure/templates/pagure-sync-bugzilla.py.j2 index 98eb81fde4..db9f5bc04c 100644 --- a/roles/distgit/pagure/templates/pagure-sync-bugzilla.py.j2 +++ b/roles/distgit/pagure/templates/pagure-sync-bugzilla.py.j2 @@ -494,12 +494,15 @@ def _is_retired_in_pdc(product, project): lead = PRODUCTS_TO_LEAD_BRANCH[product] type = PDC_TYPES[project['namespace']] name = project['name'] - pdc_url = '{0}/component-branches/?global_component={1}&type={2}&name={3}'\ - .format(PDCURL.rstrip('/'), name, type, lead) - + pdc_url = '{0}/component-branches/'.format(PDCURL.rstrip('/')) + params = dict( + global_component=name, + type=type, + name=lead, + ) if DRY_RUN: - print('Querying {0}'.format(pdc_url)) - pdc_rv = session.get(pdc_url, timeout=30) + print('Querying {0} {1}'.format(pdc_url, params)) + pdc_rv = session.get(pdc_url, params=params, timeout=30) if not pdc_rv.ok: raise RuntimeError("Could not find %r in PDC." % project) branches = pdc_rv.json()['results']