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

nickcooper-zhangtonghao nic at opencloud.tech
Tue Nov 8 00:58:41 UTC 2016


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 at opencloud.tech>
---
 utilities/ovs-tcpdump.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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)
-- 
1.8.3.1







More information about the dev mailing list