Commit 2260d39c authored by Jiri Pirko's avatar Jiri Pirko Committed by Jakub Kicinski

tools: ynl-gen: render rsp_parse() helpers if cmd has only dump op

Due to the check in RenderInfo class constructor, type_consistent
flag is set to False to avoid rendering the same response parsing
helper for do and dump ops. However, in case there is no do, the helper
needs to be rendered for dump op. So split check to achieve that.
Signed-off-by: default avatarJiri Pirko <jiri@nvidia.com>
Reviewed-by: default avatarJacob Keller <jacob.e.keller@intel.com>
Link: https://lore.kernel.org/r/20231021112711.660606-4-jiri@resnulli.usSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 4e2846fd
...@@ -1112,10 +1112,13 @@ class RenderInfo: ...@@ -1112,10 +1112,13 @@ class RenderInfo:
# 'do' and 'dump' response parsing is identical # 'do' and 'dump' response parsing is identical
self.type_consistent = True self.type_consistent = True
if op_mode != 'do' and 'dump' in op and 'do' in op: if op_mode != 'do' and 'dump' in op:
if ('reply' in op['do']) != ('reply' in op["dump"]): if 'do' in op:
self.type_consistent = False if ('reply' in op['do']) != ('reply' in op["dump"]):
elif 'reply' in op['do'] and op["do"]["reply"] != op["dump"]["reply"]: self.type_consistent = False
elif 'reply' in op['do'] and op["do"]["reply"] != op["dump"]["reply"]:
self.type_consistent = False
else:
self.type_consistent = False self.type_consistent = False
self.attr_set = attr_set self.attr_set = attr_set
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment