Skip to content

Commit

Permalink
Remove any null characters when parsing string in test_snmp_phy_entity (
Browse files Browse the repository at this point in the history
#14596)

Signed-off-by: Janetxxx <janet970527@gmail.com>
  • Loading branch information
Janetxxx committed Sep 18, 2024
1 parent 807b0c4 commit 701e39e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/snmp/test_snmp_phy_entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -808,6 +808,8 @@ def redis_hgetall(duthost, db_id, key):
return {}
# fix to make literal_eval() work with nested dictionaries
content = content.replace("'{", '"{').replace("}'", '}"')
# Remove any null characters
content = content.replace('\x00', '')
return ast.literal_eval(content)


Expand Down

0 comments on commit 701e39e

Please sign in to comment.