summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--nova/utils.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/nova/utils.py b/nova/utils.py
index d9ded16b6..5f78b93da 100644
--- a/nova/utils.py
+++ b/nova/utils.py
@@ -180,12 +180,20 @@ def execute(*cmd, **kwargs):
try:
LOG.debug(_('Running cmd (subprocess): %s'), ' '.join(cmd))
_PIPE = subprocess.PIPE # pylint: disable=E1101
+
+ if os.name == 'nt':
+ preexec_fn = None
+ close_fds = False
+ else:
+ preexec_fn = _subprocess_setup
+ close_fds = True
+
obj = subprocess.Popen(cmd,
stdin=_PIPE,
stdout=_PIPE,
stderr=_PIPE,
- close_fds=True,
- preexec_fn=_subprocess_setup,
+ close_fds=close_fds,
+ preexec_fn=preexec_fn,
shell=shell)
result = None
if process_input is not None: