]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Fixes cinder-volume service startup on Windows
authorLucian Petrut <lpetrut@cloudbasesolutions.com>
Mon, 2 Sep 2013 15:20:21 +0000 (18:20 +0300)
committerPetrut Lucian <petrutlucian94@gmail.com>
Tue, 3 Sep 2013 15:41:59 +0000 (18:41 +0300)
The Windows service fails due to missing non-blocking IO features
in eventlet. This fix adds a conditional path on Windows to execute
the service accordingly.

Fixes bug: #1219896

Change-Id: I74f662e736e3a5fe58a383d172780a691a2b36c7

bin/cinder-volume

index e9f9d1ca3f5d5aa1cbe7e07d600868c5a8dd8a49..08199f0a2d71e61b4aea09513a8bcf64c9d5d3c3 100755 (executable)
 """Starter script for Cinder Volume."""
 
 import eventlet
+import os
 
-eventlet.monkey_patch()
+if os.name == 'nt':
+    # eventlet monkey patching the os module causes subprocess.Popen to fail
+    # on Windows when using pipes due to missing non-blocking IO support.
+    eventlet.monkey_patch(os=False)
+else:
+    eventlet.monkey_patch()
 
-import os
 import sys
 
 from oslo.config import cfg
@@ -54,7 +59,11 @@ if __name__ == '__main__':
          version=version.version_string())
     logging.setup("cinder")
     utils.monkey_patch()
-    launcher = service.ProcessLauncher()
+    if os.name == 'nt':
+        launcher = service
+        launcher.launch_server = service.serve
+    else:
+        launcher = service.ProcessLauncher()
     if CONF.enabled_backends:
         for backend in CONF.enabled_backends:
             host = "%s@%s" % (CONF.host, backend)