From 0457065312a96ccc05b0f6e95defcb597db600d8 Mon Sep 17 00:00:00 2001 From: Tomas Kopecek Date: Tue, 25 Aug 2020 13:14:47 +0200 Subject: [PATCH] proton: short-circuit extra_limit = 0 Fixes: https://pagure.io/koji/issue/2455 --- plugins/hub/protonmsg.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/hub/protonmsg.py b/plugins/hub/protonmsg.py index d4409b47..219401a2 100644 --- a/plugins/hub/protonmsg.py +++ b/plugins/hub/protonmsg.py @@ -141,7 +141,9 @@ def _strip_extra(buildinfo): if not CONFIG: CONFIG = koji.read_config_files([(CONFIG_FILE, True)]) if CONFIG.has_option('message', 'extra_limit'): - extra_limit = CONFIG.getint('message', 'extra_limit') + extra_limit = abs(CONFIG.getint('message', 'extra_limit')) + if extra_limit == 0: + return buildinfo extra_size = len(json.dumps(buildinfo.get('extra', {}), default=json_serialize)) if extra_limit and extra_size > extra_limit: LOG.debug("Dropping 'extra' from build %s (length: %d > %d)" %