From 621f87f6c5fc527d64cae581eeb6571db00e64e3 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Mon, 24 Feb 2020 10:42:36 +0100 Subject: [PATCH] Redefine TargetTagsDict.get() to always use __missing__ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The code uses `target_tags.get(branch, 'rawhide')` and dict.get() doesn't use __missing__, only dict[key] access does. Patch from Miro HronĨok provided at: https://pagure.io/fedora-ci/simple-koji-ci/pull-request/37 Signed-off-by: Pierre-Yves Chibon --- roles/simple-koji-ci/templates/simple_koji_ci.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/roles/simple-koji-ci/templates/simple_koji_ci.py b/roles/simple-koji-ci/templates/simple_koji_ci.py index 613fe3709e..0f88935ce6 100644 --- a/roles/simple-koji-ci/templates/simple_koji_ci.py +++ b/roles/simple-koji-ci/templates/simple_koji_ci.py @@ -3,6 +3,10 @@ class TargetTagsDict(dict): def __missing__(self, key): return key + def get(self, key, default): + """Normally, get() doesn't go trough __missing__""" + return self[key] + config = { 'simple-koji-ci.enabled': True,