diff options
| author | Jenkins <jenkins@review.openstack.org> | 2012-11-09 19:21:17 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2012-11-09 19:21:17 +0000 |
| commit | b403a1fc2d2db89d8c365109feb2642b281faae6 (patch) | |
| tree | cfdb7bb3c4f5f5ec4ad8d21b7b24bf843afe800c | |
| parent | 67577c31b5a74f4041c636e7dfb69ea651d2c9a2 (diff) | |
| parent | c6dd816cb6f09cb0148730875f02018b4949e9b6 (diff) | |
| download | nova-b403a1fc2d2db89d8c365109feb2642b281faae6.tar.gz nova-b403a1fc2d2db89d8c365109feb2642b281faae6.tar.xz nova-b403a1fc2d2db89d8c365109feb2642b281faae6.zip | |
Merge "Fixes a bug in nova.utils, due to Windows compatibility issues."
| -rw-r--r-- | nova/utils.py | 12 |
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: |
