Add 'is_available' function

Resolves the following warnings seen in the likes of Neutron:

  opt/stack/neutron/neutron/common/eventlet_utils.py:28:
  DeprecationWarning: Please provide `is_available()`
  function in your custom Eventlet hub <module 'oslo_service'

  It must return bool: whether hub supports current platform. See
  eventlet/hubs/{epoll,kqueue} for example.

Since we're simply taking the default hub provided by eventlet and
overriding a single attribute, we will always have support so set the
attribute.

Change-Id: Ie90bcce1d1724108e5d0e583a36aa2e20102bba4
This commit is contained in:
Rodolfo Alonso Hernandez 2020-02-03 17:28:58 +00:00
parent d5b33ffc77
commit f9b5a7b6d7
1 changed files with 2 additions and 1 deletions

View File

@ -25,7 +25,8 @@ def monkey_patch():
# This issue is fixed in eventlet with patch
# https://github.com/eventlet/eventlet/commit/b756447bab51046dfc6f1e0e299cc997ab343701
# For details please check https://bugs.launchpad.net/neutron/+bug/1745013
eventlet.hubs.get_hub()
hub = eventlet.hubs.get_hub()
hub.is_available = lambda: True
if os.name != 'nt':
eventlet.monkey_patch()