mirror of
https://pagure.io/fedora-infra/ansible.git
synced 2026-03-20 03:57:02 +08:00
Redefine TargetTagsDict.get() to always use __missing__
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 <pingou@pingoured.fr>
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user