PR#1960: user proper type for buildroot state comparison

Merges #1960
https://pagure.io/koji/pull-request/1960

Fixes: #1959
https://pagure.io/koji/issue/1959
setState fails on integer buildroot state
This commit is contained in:
Tomas Kopecek 2020-02-11 10:48:20 +01:00
commit 422f9db76c

View file

@ -12557,7 +12557,7 @@ class BuildRoot(object):
if koji.BR_STATES[row['state']] == 'EXPIRED':
#we will quietly ignore a request to expire an expired buildroot
#otherwise this is an error
if state == 'EXPIRED':
if koji.BR_STATES[state] == 'EXPIRED':
return
else:
raise koji.GenericError("buildroot %i is EXPIRED" % self.id)