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

2013-11-26 Thread Jincheng Miao
Thanks for review, yes, I missed this situation: stdout is not the subprocess.PIPE. Since the stderr is always subprocess.PIPE, my another way is err after Popen.communicate(). The patch looks like: --- utils/utils.py | 2 ++--- 1 file changed, 2 insertions(+) diff --git a/utils/utils.py

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

2013-11-26 Thread Guannan Ren
On 2013年11月26日 17:17, Jincheng Miao wrote: Thanks for review, yes, I missed this situation: stdout is not the subprocess.PIPE. Since the stderr is always subprocess.PIPE, my another way is err after Popen.communicate(). The patch looks like: --- utils/utils.py | 2 ++--- 1 file changed, 2

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

2013-11-26 Thread Jincheng Miao
- Original Message - Why to append standard error to standard output. It is not right in semantics. I think test-api should replace all commands modules with utils.exec_cmd. For commands modules, it merged stderr with stdout: def getstatusoutput(cmd): Return (status, output) of

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

2013-11-26 Thread Guannan Ren
On 2013年11月27日 14:11, Jincheng Miao wrote: - Original Message - Why to append standard error to standard output. It is not right in semantics. I think test-api should replace all commands modules with utils.exec_cmd. For commands modules, it merged stderr with stdout: def

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

2013-11-25 Thread Jincheng Miao
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 @@

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

2013-11-25 Thread Guannan Ren
On 2013年11月26日 09:32, Jincheng Miao wrote: 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 ---

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

2013-11-20 Thread Jincheng Miao
- Original Message - The 'out' returned from exec_cmds is not 'None' type if stderr occurs, it is because utils pass 'subprocess.PIPE' to stdout to open this subprocess. Similarly, to get anything other than None in the result tuple, you need to give stdout=PIPE and/or stderr=PIPE

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

2013-11-20 Thread Jincheng Miao
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,

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

2013-11-19 Thread Jincheng Miao
The 'out' returned from exec_cmds is not 'None' type if stderr occurs, it is because utils pass 'subprocess.PIPE' to stdout to open this subprocess. Similarly, to get anything other than None in the result tuple, you need to give stdout=PIPE and/or stderr=PIPE too. (see