summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/export-to-postgresql.py
diff options
context:
space:
mode:
authorDonald Hunter <donald.hunter@gmail.com>2025-05-08 12:21:02 +0100
committerJakub Kicinski <kuba@kernel.org>2025-05-09 16:28:23 -0700
commit0df6932485a07f0fc44a3379038d5853cbbb505c (patch)
tree015ca478d168797f137b2e7bca1c39feb35e73a9 /tools/perf/scripts/python/export-to-postgresql.py
parent1b2900db0119c02e6445bb61ec3fba982d10cc8d (diff)
tools: ynl: handle broken pipe gracefully in CLI
When sending YNL CLI output into a pipe, closing the pipe causes a BrokenPipeError. E.g. running the following and quitting less: ./tools/net/ynl/pyynl/cli.py --family rt-link --dump getlink | less Traceback (most recent call last): File "/home/donaldh/net-next/./tools/net/ynl/pyynl/cli.py", line 160, in <module> main() ~~~~^^ File "/home/donaldh/net-next/./tools/net/ynl/pyynl/cli.py", line 142, in main output(reply) ~~~~~~^^^^^^^ File "/home/donaldh/net-next/./tools/net/ynl/pyynl/cli.py", line 97, in output pprint.PrettyPrinter().pprint(msg) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^ [...] BrokenPipeError: [Errno 32] Broken pipe Consolidate the try block for ops and notifications, and gracefully handle the BrokenPipeError by adding an exception handler to the consolidated try block. Signed-off-by: Donald Hunter <donald.hunter@gmail.com> Link: https://patch.msgid.link/20250508112102.63539-1-donald.hunter@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions