summaryrefslogtreecommitdiffstats
path: root/nova/tests
diff options
context:
space:
mode:
authorThierry Carrez <thierry@openstack.org>2011-08-09 12:21:28 +0100
committerThierry Carrez <thierry@openstack.org>2011-08-09 12:21:28 +0100
commit7e810e1f266daaa63167ea8412dc0416e88f688f (patch)
treee2c1a9908fce2965c9f5b98a1e76a5930b9d0954 /nova/tests
parented9ea0848e4c8e8220a7f3bc175d7855c88c84d0 (diff)
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/tests')
-rw-r--r--nova/tests/fake_utils.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/nova/tests/fake_utils.py b/nova/tests/fake_utils.py
index be59970c9..72f79921e 100644
--- a/nova/tests/fake_utils.py
+++ b/nova/tests/fake_utils.py
@@ -63,9 +63,11 @@ def fake_execute(*cmd_parts, **kwargs):
"""
global _fake_execute_repliers
- process_input = kwargs.get('process_input', None)
- addl_env = kwargs.get('addl_env', None)
- check_exit_code = kwargs.get('check_exit_code', 0)
+ process_input = kwargs.pop('process_input', None)
+ check_exit_code = kwargs.pop('check_exit_code', 0)
+ delay_on_retry = kwargs.pop('delay_on_retry', True)
+ attempts = kwargs.pop('attempts', 1)
+ run_as_root = kwargs.pop('run_as_root', False)
cmd_str = ' '.join(str(part) for part in cmd_parts)
LOG.debug(_("Faking execution of cmd (subprocess): %s"), cmd_str)
@@ -87,7 +89,9 @@ def fake_execute(*cmd_parts, **kwargs):
# Alternative is a function, so call it
reply = reply_handler(cmd_parts,
process_input=process_input,
- addl_env=addl_env,
+ delay_on_retry=delay_on_retry,
+ attempts=attempts,
+ run_as_root=run_as_root,
check_exit_code=check_exit_code)
except exception.ProcessExecutionError as e:
LOG.debug(_('Faked command raised an exception %s' % str(e)))