Skip to content

Commit 83529cc

Browse files
committed
Fill in missing empty attr lists
op attribute lists are referenced without checking if they are present. Attibute list can be a optional property so this patch add them initially if missing. Signed-off-by: Zibo Gong <gongzib@outlook.com>
1 parent df641c5 commit 83529cc

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

ynl-gen-cpp.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -924,6 +924,14 @@ def new_attr(self, elem, value):
924924

925925
class Operation(SpecOperation):
926926
def __init__(self, family, yaml, req_value, rsp_value):
927+
# Fill in missing operation properties (for fixed hdr-only msgs)
928+
for mode in ["do", "dump", "event"]:
929+
for direction in ["request", "reply"]:
930+
try:
931+
yaml[mode][direction].setdefault("attributes", [])
932+
except KeyError:
933+
pass
934+
927935
super().__init__(family, yaml, req_value, rsp_value)
928936

929937
self.render_name = c_lower(family.name + "_" + self.name)

0 commit comments

Comments
 (0)