tools: ynl: add more info to KeyErrors on missing attrs
authorJakub Kicinski <kuba@kernel.org>
Mon, 14 Aug 2023 20:56:27 +0000 (13:56 -0700)
committerJakub Kicinski <kuba@kernel.org>
Wed, 16 Aug 2023 02:18:34 +0000 (19:18 -0700)
commit7582113c6917c280c90352d1935cfa451e74376a
tree46f99a18fecd1ef445092b7db1b9e4b00e55f047
parentded67d90815a412f327051d27eb6c6de57cd2c03
tools: ynl: add more info to KeyErrors on missing attrs

When developing specs its useful to know which attr space
YNL was trying to find an attribute in on key error.

Instead of printing:
 KeyError: 0
add info about the space:
 Exception: Space 'vport' has no attribute with value '0'

Reviewed-by: Donald Hunter <donald.hunter@gmail.com>
Link: https://lore.kernel.org/r/20230814205627.2914583-4-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/net/ynl/lib/ynl.py