Don't retry if certificate is not readable

Fixes: https://pagure.io/koji/issue/1108
This commit is contained in:
Tomas Kopecek 2018-10-02 15:32:59 +02:00 committed by Mike McLean
parent 898de96d4d
commit 0fecbc969b

View file

@ -1931,9 +1931,10 @@ def is_requests_cert_error(e):
# Using str(e) is slightly ugly, but the error stacks in python-requests
# are way more ugly.
errstr = str(e)
if ('certificate revoked' in errstr or
'certificate expired' in errstr or
'certificate verify failed' in errstr):
if ('Permission denied' in errstr or # certificate not readable
'certificate revoked' in errstr or
'certificate expired' in errstr or
'certificate verify failed' in errstr):
return True
return False