From c8d7b8485bc27244d0dbc4c021f3f5ce228bf7f1 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Fri, 20 Nov 2015 17:29:32 +0100 Subject: [PATCH] Store the key in a variable --- roles/distgit/templates/pkgdb_sync_git_branches.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/roles/distgit/templates/pkgdb_sync_git_branches.py b/roles/distgit/templates/pkgdb_sync_git_branches.py index 9055e48a1a..70bab3c92c 100644 --- a/roles/distgit/templates/pkgdb_sync_git_branches.py +++ b/roles/distgit/templates/pkgdb_sync_git_branches.py @@ -150,14 +150,15 @@ def pkgdb_pkg_branch(): data = req.json() output = {} - for pkg in data['packageAcls']: + key = 'packageAcls' + for pkg in data[key]: if pkg in output: if VERBOSE: print 'Strange package: %s, it is present twice in the ' \ 'pkgdb output' % pkg - output[pkg].updated(data['packageAcls'][pkg].keys()) + output[pkg].updated(data[key][pkg].keys()) else: - output[pkg] = set(data['packageAcls'][pkg].keys()) + output[pkg] = set(data[key][pkg].keys()) return output