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
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
- 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
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
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
@@
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
---
- 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
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,
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