diff mbox

[ovs-dev,v2,1/4] ovs-tcpdump: Remove the newline from readline().

Message ID 1479115454-48163-2-git-send-email-nic@opencloud.tech
State Accepted
Headers show

Commit Message

nickcooper-zhangtonghao Nov. 14, 2016, 9:24 a.m. UTC
When using ovs-tcpdump, we always get the white line.
Remove newline from readline() and ovs-tcpdump will
format the output as tcpdump tool.

Signed-off-by: nickcooper-zhangtonghao <nic@opencloud.tech>
---
 utilities/ovs-tcpdump.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Aaron Conole Nov. 14, 2016, 3:35 p.m. UTC | #1
nickcooper-zhangtonghao <nic@opencloud.tech> writes:

> When using ovs-tcpdump, we always get the white line.
> Remove newline from readline() and ovs-tcpdump will
> format the output as tcpdump tool.
>
> Signed-off-by: nickcooper-zhangtonghao <nic@opencloud.tech>
> ---

I acked this with V1, so:

Acked-by: Aaron Conole <aconole@redhat.com>
diff mbox

Patch

diff --git a/utilities/ovs-tcpdump.in b/utilities/ovs-tcpdump.in
index b29e691..01e1f6d 100755
--- a/utilities/ovs-tcpdump.in
+++ b/utilities/ovs-tcpdump.in
@@ -426,7 +426,7 @@  def main():
     pipes = _doexec(*([dump_cmd, '-i', mirror_interface] + tcpdargs))
     try:
         while pipes.poll() is None:
-            data = pipes.stdout.readline()
+            data = pipes.stdout.readline().strip('\n')
             if len(data) == 0:
                 raise KeyboardInterrupt
             print(data)