aboutsummaryrefslogtreecommitdiff
path: root/tools/net/ynl/lib/ynl.py
diff options
context:
space:
mode:
authorJakub Kicinski <[email protected]>2023-10-16 14:39:37 -0700
committerJakub Kicinski <[email protected]>2023-10-17 17:59:46 -0700
commit9fea94d3a8cadd83f5de22eae953bd9e951d5215 (patch)
treed703ddea5f5c33dd2dc8597b6c07d4aa4b2b1680 /tools/net/ynl/lib/ynl.py
parent9fe1450f6d3ce67d963c195d3fb8510d9c673bdd (diff)
tools: ynl: fix converting flags to names after recent cleanup
I recently cleaned up specs to not specify enum-as-flags when target enum is already defined as flags. YNL Python library did not convert flags, unfortunately, so this caused breakage for Stan and Willem. Note that the nlspec.py abstraction already hides the differences between flags and enums (value vs user_value), so the changes are pretty trivial. Fixes: 0629f22ec130 ("ynl: netdev: drop unnecessary enum-as-flags") Reported-and-tested-by: Willem de Bruijn <[email protected]> Reported-and-tested-by: Stanislav Fomichev <[email protected]> Link: https://lore.kernel.org/all/[email protected]/ Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
Diffstat (limited to 'tools/net/ynl/lib/ynl.py')
-rw-r--r--tools/net/ynl/lib/ynl.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/net/ynl/lib/ynl.py b/tools/net/ynl/lib/ynl.py
index 13c4b019a881..28ac35008e65 100644
--- a/tools/net/ynl/lib/ynl.py
+++ b/tools/net/ynl/lib/ynl.py
@@ -474,7 +474,7 @@ class YnlFamily(SpecFamily):
def _decode_enum(self, raw, attr_spec):
enum = self.consts[attr_spec['enum']]
- if 'enum-as-flags' in attr_spec and attr_spec['enum-as-flags']:
+ if enum.type == 'flags' or attr_spec.get('enum-as-flags', False):
i = 0
value = set()
while raw: