From b89f76bd4d7936e2a5ecf26a8ef59f1585e1bf25 Mon Sep 17 00:00:00 2001 From: Thomas Vogel Date: Thu, 13 Jun 2019 09:44:01 +0200 Subject: n3xx: bugfix for mpm set_db_eeprom access via network access or data as bytes instead of str was not possible due to unconditional assert check for str --- mpm/python/usrp_mpm/periph_manager/n3xx.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'mpm/python/usrp_mpm') diff --git a/mpm/python/usrp_mpm/periph_manager/n3xx.py b/mpm/python/usrp_mpm/periph_manager/n3xx.py index 0a2801f44..3e53ba854 100644 --- a/mpm/python/usrp_mpm/periph_manager/n3xx.py +++ b/mpm/python/usrp_mpm/periph_manager/n3xx.py @@ -1009,12 +1009,15 @@ class n3xx(ZynqComponents, PeriphManagerBase): self.log.error(error_msg) raise RuntimeError(error_msg) if not isinstance(blob, str) and not isinstance(blob, bytes): - error_msg = "Blob data for ID `{}' is not a " \ - "string!".format(blob_id) + error_msg = "Blob data for ID `{}' is neither a " \ + "string nor already bytes!".format(blob_id) self.log.error(error_msg) raise RuntimeError(error_msg) - assert isinstance(blob, str) - safe_db_eeprom_user_data[blob_id] = blob.encode('ascii') + if isinstance(blob, str): + safe_db_eeprom_user_data[blob_id] = blob.encode('ascii') + else: + safe_db_eeprom_user_data[blob_id] = blob + dboard.set_user_eeprom_data(safe_db_eeprom_user_data) ########################################################################### -- cgit v1.2.3