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:
Victor Stinner 2015-01-06 21:50:03 +01:00
parent ea7c513ff7
commit 5793aff190
1 changed files with 3 additions and 5 deletions

View File

@ -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)