Skip to content

Commit

Permalink
Close file descriptors when executing sub-processes
Browse files Browse the repository at this point in the history
Pass close_fds=True to subprocess.Popen(), as is currently done in
nova.utils.execute().

Note that this folsom-stable branch fix is not a cherry-pick of the
master branch fix at https://review.openstack.org/22486 due to prior
refactoring in grizzly.

Fixes bug #1130735

Change-Id: Ia7a889b21a8069b559cb4641480abf416dfc903c
  • Loading branch information
Bob Kukura committed Feb 20, 2013
1 parent 4de49b4 commit 30bb632
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion quantum/agent/linux/utils.py
Expand Up @@ -49,7 +49,7 @@ def execute(cmd, root_helper=None, process_input=None, addl_env=None,
env.update(addl_env)
obj = subprocess.Popen(cmd, shell=False, stdin=subprocess.PIPE,
stdout=subprocess.PIPE, stderr=subprocess.PIPE,
preexec_fn=_subprocess_setup,
preexec_fn=_subprocess_setup, close_fds=True,
env=env)

_stdout, _stderr = (process_input and
Expand Down
2 changes: 1 addition & 1 deletion quantum/common/utils.py
Expand Up @@ -61,7 +61,7 @@ def execute(cmd, process_input=None, addl_env=None, check_exit_code=True):
env.update(addl_env)
obj = subprocess.Popen(cmd, shell=True, stdin=subprocess.PIPE,
stdout=subprocess.PIPE, stderr=subprocess.PIPE,
preexec_fn=_subprocess_setup,
preexec_fn=_subprocess_setup, close_fds=True,
env=env)
result = None
if process_input is not None:
Expand Down

0 comments on commit 30bb632

Please sign in to comment.