[libvirt] [libvirt-test-API][PATCH] Fix utils.exec_cmd output problem

Jincheng Miao jmiao at redhat.com
Tue Nov 26 01:32:30 UTC 2013


ping gren

----- Original Message -----
> As described before, this patch should be :
> 
> ---
>  utils/utils.py | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/utils/utils.py b/utils/utils.py
> index 147c1ef..ec09c33 100644
> --- a/utils/utils.py
> +++ b/utils/utils.py
> @@ -409,9 +409,8 @@ def exec_cmd(command, sudo=False, cwd=None, infile=None,
> outfile=None, shell=Fal
>      p = subprocess.Popen(command, shell=shell, close_fds=True, cwd=cwd,
>                      stdin=infile, stdout=outfile, stderr=subprocess.PIPE)
>      (out, err) = p.communicate(data)
> -    if out == None:
> -        # Prevent splitlines() from barfing later on
> -        out = ""
> +    if out == "":
> +        out = err
>      return (p.returncode, out.splitlines())
>  
>  def remote_exec_pexpect(hostname, username, password, cmd):
> --
> 1.8.3.1
> 




More information about the libvir-list mailing list