tools: ynl: don't append doc of missing type directly to the type
authorJakub Kicinski <kuba@kernel.org>
Fri, 26 Apr 2024 00:31:11 +0000 (17:31 -0700)
committerJakub Kicinski <kuba@kernel.org>
Sat, 27 Apr 2024 00:35:03 +0000 (17:35 -0700)
When using YNL in tests appending the doc string to the type
name makes it harder to check that we got the correct error.
Put the doc under a separate key.

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

index 35f82a2c224724a3ac0edd26f45478541e1ad679..35e666928119b0ef8915224ee7b73794873aeac3 100644 (file)
@@ -233,10 +233,9 @@ class NlMsg:
                     miss_type = self.extack['miss-type']
                     if miss_type in attr_space.attrs_by_val:
                         spec = attr_space.attrs_by_val[miss_type]
-                        desc = spec['name']
+                        self.extack['miss-type'] = spec['name']
                         if 'doc' in spec:
-                            desc += f" ({spec['doc']})"
-                        self.extack['miss-type'] = desc
+                            self.extack['miss-type-doc'] = spec['doc']
 
     def _decode_policy(self, raw):
         policy = {}