From a7d30ec5309d27ffa5028eaf966891bb78537950 Mon Sep 17 00:00:00 2001 From: Alessandro Pilotti Date: Sat, 3 Nov 2012 20:54:12 +0200 Subject: [PATCH] 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 --- bin/nova-compute | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/bin/nova-compute b/bin/nova-compute index 2a2a0013..a926aa07 100755 --- a/bin/nova-compute +++ b/bin/nova-compute @@ -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