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.

Conflicts:
        nova/virt/libvirt/host.py

NOTE(mriedem): The conflict is due to the host module being
newly refactored out of the driver module in Kilo.

Change-Id: Idbb9d2b53829dae0e807cd1260dee3dce155d5f3
Closes-Bug: 1407685
(cherry picked from commit 5793aff190)
This commit is contained in:
Victor Stinner 2015-01-06 21:50:03 +01:00 committed by Matt Riedemann
parent d9bcfab1e9
commit 9f81d9bb34
1 changed files with 3 additions and 5 deletions

View File

@ -45,7 +45,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 lxml import etree
from oslo.config import cfg
import six
@ -110,6 +109,7 @@ from nova.virt import watchdog_actions
from nova import volume
from nova.volume import encryptors
native_socket = patcher.original('socket')
native_threading = patcher.original("threading")
native_Queue = patcher.original("Queue")
@ -638,12 +638,10 @@ class LibvirtDriver(driver.ComputeDriver):
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)