tools: ynl: make definitions optional again

definitions are optional, commit in question breaks cli for ethtool.

Fixes: 6517a60b03 ("tools: ynl: move the enum classes to shared code")
Reviewed-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
Jakub Kicinski 2023-03-15 16:03:49 -07:00
parent 0d2be75ce7
commit 054abb515f

View File

@ -387,7 +387,8 @@ class SpecFamily(SpecElement):
def resolve(self):
self.resolve_up(super())
for elem in self.yaml['definitions']:
definitions = self.yaml.get('definitions', [])
for elem in definitions:
if elem['type'] == 'enum' or elem['type'] == 'flags':
self.consts[elem['name']] = self.new_enum(elem)
else: