Update eventlet API in libvirt driver
Stop using the deprecated eventlet.util API: use eventlet.patcher.original('socket') to access the original socket.socket type. Change-Id: Idbb9d2b53829dae0e807cd1260dee3dce155d5f3 Closes-Bug: 1407685
This commit is contained in:
parent
ea7c513ff7
commit
5793aff190
|
@ -36,7 +36,6 @@ from eventlet import greenio
|
|||
from eventlet import greenthread
|
||||
from eventlet import patcher
|
||||
from eventlet import tpool
|
||||
from eventlet import util as eventlet_util
|
||||
|
||||
from nova import exception
|
||||
from nova.i18n import _
|
||||
|
@ -49,6 +48,7 @@ libvirt = None
|
|||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
native_socket = patcher.original('socket')
|
||||
native_threading = patcher.original("threading")
|
||||
native_Queue = patcher.original("Queue")
|
||||
|
||||
|
@ -294,12 +294,10 @@ class Host(object):
|
|||
except (ImportError, NotImplementedError):
|
||||
# This is Windows compatibility -- use a socket instead
|
||||
# of a pipe because pipes don't really exist on Windows.
|
||||
sock = eventlet_util.__original_socket__(socket.AF_INET,
|
||||
socket.SOCK_STREAM)
|
||||
sock = native_socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||
sock.bind(('localhost', 0))
|
||||
sock.listen(50)
|
||||
csock = eventlet_util.__original_socket__(socket.AF_INET,
|
||||
socket.SOCK_STREAM)
|
||||
csock = native_socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||
csock.connect(('localhost', sock.getsockname()[1]))
|
||||
nsock, addr = sock.accept()
|
||||
self._event_notify_send = nsock.makefile('wb', 0)
|
||||
|
|
Loading…
Reference in New Issue