From 5d3a6d2044d69d68ec7371608227dcadd1eda332 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Tue, 16 Mar 2021 17:18:47 +0100 Subject: 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. --- mpm/python/usrp_mpm/periph_manager/base.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'mpm') 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): """ -- cgit v1.2.3