On Mon, Apr 26, 2010 at 7:04 AM, Jason Wang <[email protected]> wrote:
> Need to raise the error when met the unknown type of shell_client in
> kvm_vm.remote_login() in order to avoid the traceback.

In order to keep consistency, please make the function return None
instead of throwing an exception. You might log the message as a
logging.error() record.

> Signed-off-by: Jason Wang <[email protected]>
> ---
>  client/tests/kvm/kvm_vm.py |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
>
> diff --git a/client/tests/kvm/kvm_vm.py b/client/tests/kvm/kvm_vm.py
> index 8f4753f..0cdf925 100755
> --- a/client/tests/kvm/kvm_vm.py
> +++ b/client/tests/kvm/kvm_vm.py
> @@ -806,7 +806,9 @@ class VM:
>         elif client == "nc":
>             session = kvm_utils.netcat(address, port, username, password,
>                                        prompt, linesep, timeout)
> -
> +        else:
> +            raise error.TestError("Unknown shell_client type %s" % client)
> +
>         if session:
>             session.set_status_test_command(self.params.get("status_test_"
>                                                             "command", ""))
>
> _______________________________________________
> Autotest mailing list
> [email protected]
> http://test.kernel.org/cgi-bin/mailman/listinfo/autotest
>



-- 
Lucas
_______________________________________________
Autotest mailing list
[email protected]
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest

Reply via email to