From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from proxy.6wind.com (host.76.145.23.62.rev.coltfrance.com [62.23.145.76]) by dpdk.org (Postfix) with ESMTP id E89A45902; Fri, 26 Aug 2016 15:15:40 +0200 (CEST) Received: from glumotte.dev.6wind.com (unknown [10.16.0.195]) by proxy.6wind.com (Postfix) with ESMTP id 8E3BB24B51; Fri, 26 Aug 2016 15:15:40 +0200 (CEST) From: Olivier Matz To: dev@dpdk.org, nhorman@tuxdriver.com, thomas.monjalon@6wind.com Cc: stable@dpdk.org Date: Fri, 26 Aug 2016 15:15:32 +0200 Message-Id: <1472217332-26077-1-git-send-email-olivier.matz@6wind.com> X-Mailer: git-send-email 2.8.1 Subject: [dpdk-stable] [PATCH] tools: fix json output of pmdinfo X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Aug 2016 13:15:41 -0000 Using dpdk-pmdinfo with the '-r' flag does not produce a json output as documented. Instead, the python representation of the json object is shown, which is nearly the same, but cannot be properly parsed by a json parser. python repr (before): {u'pci_ids': [[5549, 1968, 65535, 65535]], u'name': u'vmxnet3'} json (after): {"pci_ids": [[5549, 1968, 65535, 65535]], "name": "vmxnet3"} Fixes: c67c9a5c646a ("tools: query binaries for HW and other support information") Signed-off-by: Olivier Matz --- tools/dpdk-pmdinfo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/dpdk-pmdinfo.py b/tools/dpdk-pmdinfo.py index dcc8db8..3db9819 100755 --- a/tools/dpdk-pmdinfo.py +++ b/tools/dpdk-pmdinfo.py @@ -319,7 +319,7 @@ class ReadElf(object): pmdinfo = json.loads(mystring) if raw_output: - print(pmdinfo) + print(json.dumps(pmdinfo)) return print("PMD NAME: " + pmdinfo["name"]) -- 2.8.1