diff options
| author | Thierry Carrez <thierry@openstack.org> | 2011-08-09 12:21:28 +0100 |
|---|---|---|
| committer | Thierry Carrez <thierry@openstack.org> | 2011-08-09 12:21:28 +0100 |
| commit | 7e810e1f266daaa63167ea8412dc0416e88f688f (patch) | |
| tree | e2c1a9908fce2965c9f5b98a1e76a5930b9d0954 /nova/utils.py | |
| parent | ed9ea0848e4c8e8220a7f3bc175d7855c88c84d0 (diff) | |
| download | nova-7e810e1f266daaa63167ea8412dc0416e88f688f.tar.gz nova-7e810e1f266daaa63167ea8412dc0416e88f688f.tar.xz nova-7e810e1f266daaa63167ea8412dc0416e88f688f.zip | |
Fix usage of sudo -E and addl_env in dnsmasq/radvd calls, remove addl_env support, fix fake_execute allowed kwargs
Diffstat (limited to 'nova/utils.py')
| -rw-r--r-- | nova/utils.py | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/nova/utils.py b/nova/utils.py index d691481f8..dc81abdb9 100644 --- a/nova/utils.py +++ b/nova/utils.py @@ -132,7 +132,6 @@ def execute(*cmd, **kwargs): :cmd Passed to subprocess.Popen. :process_input Send to opened process. - :addl_env Added to the processes env. :check_exit_code Defaults to 0. Raise exception.ProcessExecutionError unless program exits with this code. :delay_on_retry True | False. Defaults to True. If set to True, wait a @@ -147,7 +146,6 @@ def execute(*cmd, **kwargs): """ process_input = kwargs.pop('process_input', None) - addl_env = kwargs.pop('addl_env', None) check_exit_code = kwargs.pop('check_exit_code', 0) delay_on_retry = kwargs.pop('delay_on_retry', True) attempts = kwargs.pop('attempts', 1) @@ -164,16 +162,12 @@ def execute(*cmd, **kwargs): attempts -= 1 try: LOG.debug(_('Running cmd (subprocess): %s'), ' '.join(cmd)) - env = os.environ.copy() - if addl_env: - env.update(addl_env) _PIPE = subprocess.PIPE # pylint: disable=E1101 obj = subprocess.Popen(cmd, stdin=_PIPE, stdout=_PIPE, stderr=_PIPE, - close_fds=True, - env=env) + close_fds=True) result = None if process_input is not None: result = obj.communicate(process_input) |
