diff options
author | Ralph Bean <rbean@redhat.com> | 2017-08-17 15:27:32 +0000 |
---|---|---|
committer | Ralph Bean <rbean@redhat.com> | 2017-08-17 15:27:32 +0000 |
commit | 7ba8e622593c49e090f5250ca699fc19be1fca6d (patch) | |
tree | 6905b74b8a828d249e2291f898447f2706899477 | |
parent | 0e747aa620978903e7881e5b470fe95f9cf2a54f (diff) | |
download | ansible-7ba8e622593c49e090f5250ca699fc19be1fca6d.tar.gz ansible-7ba8e622593c49e090f5250ca699fc19be1fca6d.tar.xz ansible-7ba8e622593c49e090f5250ca699fc19be1fca6d.zip |
Fix incorrect handling of API response.
-rw-r--r-- | roles/distgit/pagure/templates/pagure-sync-bugzilla.py.j2 | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/roles/distgit/pagure/templates/pagure-sync-bugzilla.py.j2 b/roles/distgit/pagure/templates/pagure-sync-bugzilla.py.j2 index 72dacdf93..98eb81fde 100644 --- a/roles/distgit/pagure/templates/pagure-sync-bugzilla.py.j2 +++ b/roles/distgit/pagure/templates/pagure-sync-bugzilla.py.j2 @@ -502,7 +502,10 @@ def _is_retired_in_pdc(product, project): pdc_rv = session.get(pdc_url, timeout=30) if not pdc_rv.ok: raise RuntimeError("Could not find %r in PDC." % project) - return not pdc_rv.json()['active'] + branches = pdc_rv.json()['results'] + if not branches: + raise RuntimeError("No results for %r in PDC." % project) + return branches[0]['active'] @cache.cache_on_arguments() |