usertools: fix handling EOF for telemetry input pipe
authorBruce Richardson <bruce.richardson@intel.com>
Mon, 13 Sep 2021 10:51:36 +0000 (11:51 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Fri, 1 Oct 2021 15:30:26 +0000 (17:30 +0200)
commit744e9a87c582d687d5d20b61b7ee0835da421541
tree64f83791e4521b86c168bb96dbc9fc84592a33ad
parentea3ef0b85f54f791234126634aa7bdd3d6b39cc5
usertools: fix handling EOF for telemetry input pipe

To allow the script to take queries from input pipes e.g. "echo
/ethdev/stats,0 | dpdk-telemetry.py", we need to handle the case of EOF
correctly without crashing with an exception. Do this by using a
try-except block around the input handling.

Fixes: 6a2967c112a3 ("usertools: add new telemetry script")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Ciara Power <ciara.power@intel.com>
usertools/dpdk-telemetry.py