On 06/01/2012 02:35 AM, guyanhua wrote: > > Add a param( default raise_error = True) in run function, thus when virsh > command gets a wrong param and isnt't expected to raise error, we can > set raise_error = False. > > Signed-off-by: Gu Yanhua<guyanhua-f...@cn.fujitsu.com> > --- > client/shared/base_utils.py | 4 ++-- > 1 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/client/shared/base_utils.py b/client/shared/base_utils.py > index 8e38413..914f7ab 100644 > --- a/client/shared/base_utils.py > +++ b/client/shared/base_utils.py > @@ -744,7 +744,7 @@ def get_stderr_level(stderr_is_expected): > > def run(command, timeout=None, ignore_status=False, > stdout_tee=None, stderr_tee=None, verbose=True, stdin=None, > - stderr_is_expected=None, args=()): > + stderr_is_expected=None, args=(), raise_error=True): > """ > Run a command on the host. > > @@ -783,7 +783,7 @@ def run(command, timeout=None, ignore_status=False, > (BgJob(command, stdout_tee, stderr_tee, verbose, stdin=stdin, > stderr_level=get_stderr_level(stderr_is_expected)),), > timeout)[0] > - if not ignore_status and bg_job.result.exit_status: > + if not ignore_status and bg_job.result.exit_status and raise_error: > raise error.CmdError(command, bg_job.result, > "Command returned non-zero exit status")
Isn't 'raise_error' just the logical inverse of the 'ignore_status' parameter? -- Chris Evich, RHCA, RHCE, RHCDS, RHCSS Quality Assurance Engineer e-mail: cevich + `@' + redhat.com o: 1-888-RED-HAT1 x44214 _______________________________________________ Autotest mailing list Autotest@test.kernel.org http://test.kernel.org/cgi-bin/mailman/listinfo/autotest