Add hotfix for koji ssl issues.

This commit is contained in:
Kevin Fenzi 2015-08-15 17:20:47 +00:00
parent 7b9b3db1eb
commit 9891e0e4e2
2 changed files with 29 additions and 2 deletions

View file

@ -1943,8 +1943,29 @@ class ClientSession(object):
except Exception, e:
self._close_connection()
if isinstance(e, OpenSSL.SSL.Error):
for arg in e.args:
for _, _, ssl_reason in arg:
# pyOpenSSL doesn't use different exception
# subclasses, we have to actually parse the args
for arg in e.args:
# First, check to see if 'arg' is iterable because
# it can be anything..
try:
iter(arg)
except TypeError:
continue
# We do all this so that we can detect cert expiry
# so we can avoid retrying those over and over.
for items in arg:
try:
iter(items)
except TypeError:
continue
if len(items) != 3:
continue
_, _, ssl_reason = items
if ('certificate revoked' in ssl_reason or
'certificate expired' in ssl_reason):
# There's no point in retrying for this

View file

@ -255,3 +255,9 @@
tags:
- koji_builder
- name: HOTFIX ssl fix for koji
copy: src=__init__.py dest=/usr/lib/python2.7/site-packages/koji/__init__.py
tags:
- koji_builder
- hotfix