From: Paul Vinciguerra Date: Wed, 9 Jan 2019 05:36:39 +0000 (-0800) Subject: Simplify test/util.py:ppp. X-Git-Tag: v19.04-rc1~638 X-Git-Url: https://gerrit.fd.io/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F32%2F16732%2F3;p=vpp.git Simplify test/util.py:ppp. Change-Id: I10596335c7e8f51afc4bcee75132b7a25ebf2a4e Signed-off-by: Paul Vinciguerra --- diff --git a/test/util.py b/test/util.py index 9652b803f1d..cf45c85a5f4 100644 --- a/test/util.py +++ b/test/util.py @@ -19,15 +19,9 @@ from vpp_papi import mac_pton def ppp(headline, packet): """ Return string containing the output of scapy packet.show() call. """ - o = BytesIO() - old_stdout = sys.stdout - sys.stdout = o - print(headline) - hexdump(packet) - print("") - packet.show() - sys.stdout = old_stdout - return o.getvalue() + return '%s\n%s\n\n%s\n' % (headline, + hexdump(packet, dump=True), + packet.show(dump=True)) def ppc(headline, capture, limit=10):