Skip to content

Commit

Permalink
Fix: no need to decode() after redis client scan, so it will work for…
Browse files Browse the repository at this point in the history
… both python2 and python3 (sonic-net#96)

The original code was tested in python2, which convert a str to a unicode str. It is working but not needed.
  • Loading branch information
qiluo-msft committed Nov 18, 2020
1 parent 54f977a commit 1664be9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/swsssdk/configdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ def __get_config(self, client, pipe, data, cursor):
cur: poition of next item to scan
"""
cur, keys = client.scan(cursor=cursor, match='*', count=self.REDIS_SCAN_BATCH_SIZE)
keys = [key.decode() for key in keys if key != self.INIT_INDICATOR]
keys = [key for key in keys if key != self.INIT_INDICATOR]
for key in keys:
pipe.hgetall(key)
records = pipe.execute()
Expand Down

0 comments on commit 1664be9

Please sign in to comment.