Skip to content

Commit

Permalink
Update pyang-apteryx-xml.py and pyang-cpaths.py
Browse files Browse the repository at this point in the history
pyang-apteryx-xml.py was modified to allow features to be passed an
empty string. This helps certain script files.

pyang-cpaths.py was modified to fix an error noticed when compiling the
openconfig-interfaces model.
  • Loading branch information
gcampbell512 committed Nov 3, 2023
1 parent 12e3058 commit 0e98477
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions pyang-apteryx-xml.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,10 @@ def emit(self, ctx, modules, fd):
if rev is not None:
root.set("version", rev.arg)
if ctx.opts.features:
features_string = ','.join(ctx.opts.features)
root.set("features", features_string)
# Ignore the features list if it is empty
if len(ctx.opts.features[0]) > 0:
features_string = ','.join(ctx.opts.features)
root.set("features", features_string)
if ctx.opts.deviations:
lst = []
for x in ctx.opts.deviations:
Expand Down
3 changes: 2 additions & 1 deletion pyang-cpaths.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@ def print_node(node, module, prefix, fd, ctx, level=0, strip=0):
typedef.i_config = node.i_config
if node.i_default is not None:
typedef.i_default = node.i_default
typedef.i_default_str = node.i_default_str
if hasattr(node, "i_default_str"):
typedef.i_default_str = node.i_default_str
typedef.keyword = node.keyword
node = typedef
ntype = node.search_one('type')
Expand Down

0 comments on commit 0e98477

Please sign in to comment.