Skip to content

Commit

Permalink
fix(enodebd): Add workaround logic for stale msg name in dictionary (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
talkhasib authored and themarwhal committed Jul 6, 2021
1 parent 4c5c578 commit 1f26ba8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def gps_tr181(value: str) -> str:
"""
try:
return str(float(value) / 1e6)
except ValueError:
except Exception: # pylint: disable=broad-except
return value


Expand Down
9 changes: 9 additions & 0 deletions lte/gateway/python/magma/enodebd/tr069/spyne_mods.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,15 @@ def get_call_handles(self, ctx):
return super(Tr069Soap11, self).get_call_handles(ctx)

def serialize(self, ctx, message):
# Workaround for issue https://github.com/magma/magma/issues/7869
# Updates to ctx.descriptor.out_message.Attributes.sub_name are taking
# effect on the descriptor. But when puled from _attrcache dictionary,
# it still has a stale value.
# Force repopulation of dictionary by deleting entry
# TODO Remove this code once we have a better fix
if (ctx.descriptor.out_message in self._attrcache):
del self._attrcache[ctx.descriptor.out_message] # noqa: WPS529

super(Tr069Soap11, self).serialize(ctx, message)

# Keep XSD namespace
Expand Down

0 comments on commit 1f26ba8

Please sign in to comment.