zookeeper: do not hard depend on eventlet

Change-Id: Idadfc61c932bda6ab551dc941c8a53da990c6733
This commit is contained in:
Julien Danjou 2016-05-26 14:30:44 +02:00
parent 36655c68fe
commit d096a0db87
2 changed files with 8 additions and 5 deletions

View File

@ -24,6 +24,3 @@ sysv-ipc>=0.6.8 # BSD License
kazoo>=2.2 # Apache-2.0
pymemcache!=1.3.0,>=1.2.9 # Apache 2.0 License
redis>=2.10.0 # MIT
# Ensure that the eventlet executor continues to operate...
eventlet!=0.18.3,>=0.18.2 # MIT

View File

@ -19,7 +19,10 @@ import copy
from kazoo import client
from kazoo import exceptions
from kazoo.handlers import eventlet as eventlet_handler
try:
from kazoo.handlers import eventlet as eventlet_handler
except ImportError:
eventlet_handler = None
from kazoo.handlers import threading as threading_handler
from kazoo.protocol import paths
from oslo_utils import encodeutils
@ -425,9 +428,12 @@ class KazooDriver(BaseZooKeeperDriver):
"""
HANDLERS = {
'eventlet': eventlet_handler.SequentialEventletHandler,
'threading': threading_handler.SequentialThreadingHandler,
}
if eventlet_handler:
HANDLERS['eventlet'] = eventlet_handler.SequentialEventletHandler
"""
Restricted immutable dict of handler 'kinds' -> handler classes that
this driver can accept via 'handler' option key (the expected value for