Fixes volume attach issue on Hyper-V

Fixes Bug: #1074717

During volume attach on Windows a process is spawned. The process
currently fails with the following exception, due to eventlet monkey
patching of the os module.

NotImplementedError: set_nonblocking() on a file object with no
setblocking() method (Windows pipes don't support non-blocking I/O)

The fix consists in avoiding monkey patching the os module in
nova-compute on Hyper-V

Change-Id: Ib513bc218da83b751439bad114baac24b08e3d02
This commit is contained in:
Alessandro Pilotti
2012-11-03 20:54:12 +02:00
parent 7949cbf5b4
commit a7d30ec530

View File

@@ -20,7 +20,14 @@
"""Starter script for Nova Compute."""
import eventlet
eventlet.monkey_patch()
import os
if os.name == 'nt':
# eventlet monkey patching causes subprocess.Popen to fail on Windows
# when using pipes due to missing non blocking I/O support
eventlet.monkey_patch(os=False)
else:
eventlet.monkey_patch()
import os
import sys