Skip to content

Commit

Permalink
Fix Netconf key elements' serialization order (#363) (#460)
Browse files Browse the repository at this point in the history
* Updates order of serialization of key elements acc. to the RFCs
  • Loading branch information
shgandhi authored and Abhi Keshav committed May 30, 2017
1 parent 8ddd213 commit 5979337
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ydkgen/api_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ def get_key_props(self):
for prop in [p for p in self.owned_elements if isinstance(p, Property)]:
if prop.stmt in key_stmts:
key_props.append(prop)
return sorted(key_props, key=lambda k: k.name)
return key_props

def __eq__(self, other):
if isinstance(other, self.__class__):
Expand Down Expand Up @@ -851,7 +851,7 @@ def get_properties(owned_elements):

# first get the key properties
key_props = [p for p in all_props if p.is_key()]
props.extend(sorted(key_props, key=lambda p:p. name))
props.extend(key_props)

non_key_props = [p for p in all_props if not p.is_key()]
props.extend(sorted(non_key_props, key=lambda p: p.name))
Expand Down

0 comments on commit 5979337

Please sign in to comment.