aboutsummaryrefslogtreecommitdiffstats
path: root/mpm/python
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2021-03-16 17:18:47 +0100
committerAaron Rossetto <aaron.rossetto@ni.com>2021-03-25 07:56:30 -0500
commit5d3a6d2044d69d68ec7371608227dcadd1eda332 (patch)
treeff40b945871563a33114b27583207a910163ed98 /mpm/python
parenta00e5e7168aea0943ec54602b0cf2e3b6c84ddb9 (diff)
downloaduhd-5d3a6d2044d69d68ec7371608227dcadd1eda332.tar.gz
uhd-5d3a6d2044d69d68ec7371608227dcadd1eda332.tar.bz2
uhd-5d3a6d2044d69d68ec7371608227dcadd1eda332.zip
mpm: periph manager: Fix get_mb_eeprom() return value formatting
The get_mb_eeprom() RPC call is supposed to return a string -> string map and thus converts all EEPROM entries to strings. However, for raw strings, the existing conversion (using str()) was not correct (we need to decode raw strings first). This would lead to things like the serial being returned as b'ABCD123' instead of just ABCD123.
Diffstat (limited to 'mpm/python')
-rw-r--r--mpm/python/usrp_mpm/periph_manager/base.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/mpm/python/usrp_mpm/periph_manager/base.py b/mpm/python/usrp_mpm/periph_manager/base.py
index 2b4b297ed..a1c5e4d4a 100644
--- a/mpm/python/usrp_mpm/periph_manager/base.py
+++ b/mpm/python/usrp_mpm/periph_manager/base.py
@@ -815,7 +815,10 @@ class PeriphManagerBase(object):
All key/value pairs are string -> string
"""
- return {k: str(v) for k, v in iteritems(self._eeprom_head)}
+ return {
+ k: v.decode() if isinstance(v, bytes) else str(v)
+ for k, v in iteritems(self._eeprom_head)
+ }
def set_mb_eeprom(self, eeprom_vals):
"""