Skip to content

Commit

Permalink
Merge pull request #1103 from projectcalico/centos-usage-reporting
Browse files Browse the repository at this point in the history
Fix usage reporting on CentOS 7
  • Loading branch information
fasaxc committed Sep 20, 2016
2 parents a3c1346 + 891d27e commit 4ad9462
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
16 changes: 15 additions & 1 deletion calico/felix/felix.py
Expand Up @@ -20,7 +20,21 @@
The main logic for Felix.
"""
# Monkey-patch before we do anything else...
# CentOS/RHEL 7 has a Python that thinks it is 2.7.5, but is actually heavily
# patched with various backports, and in particular with SSL-related changes
# for PEP 466, which in the mainline were introduced in Python 2.7.9. gevent
# (>= 1.0.2) has support for modifying its monkey-patching accordingly, but
# that is conditional on whether it thinks the Python version is >= 2.7.9.
# Happily gevent has a global variable for that, so here we set that global
# variable to indicate that we are effectively - so far as the SSL-related
# things that gevent patches are concerned - running on 2.7.9.
try:
from gevent import hub
hub.PYGTE279 = True
except (ImportError, AttributeError):
pass

# Now monkey-patch before we do anything else...
from gevent import monkey
monkey.patch_all()

Expand Down
2 changes: 1 addition & 1 deletion calico/felix/futils.py
Expand Up @@ -676,4 +676,4 @@ def report_usage_and_get_warnings(calico_version, hostname, cluster_guid, cluste
reply = r.data.decode('utf-8')
_log.info("usage_report status=%s, reply=%s", r.status, reply)
except Exception:
_log.info("Exception in usage_report")
_log.exception("Exception in usage_report")

0 comments on commit 4ad9462

Please sign in to comment.