From e45c909235825f22e2ac7da63a4d6454399224e3 Mon Sep 17 00:00:00 2001 From: Patrick Uiterwijk Date: Feb 20 2018 09:10:11 +0000 Subject: Fix comparison with Enum value The CHECKSUM_TYPES[...] call returns the index in the Enum field, not a string, which meant that the comparison would never work. Reported-by: Clement Verna Signed-off-by: Patrick Uiterwijk --- diff --git a/hub/kojihub.py b/hub/kojihub.py index eb9b67d..f910595 100644 --- a/hub/kojihub.py +++ b/hub/kojihub.py @@ -5581,7 +5581,7 @@ class CG_Importer(object): (filesize, fileinfo['filename'], fileinfo['filesize'])) # checksum - if koji.CHECKSUM_TYPES[fileinfo['checksum_type']] != 'md5': + if fileinfo['checksum_type'] != 'md5': # XXX # until we change the way we handle checksums, we have to limit this to md5 raise koji.GenericError("Unsupported checksum type: %(checksum_type)s" % fileinfo)