diff options
author | Thomas Vogel <thomas.vogel@ni.com> | 2019-06-13 09:44:01 +0200 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2019-06-13 09:00:46 -0700 |
commit | b89f76bd4d7936e2a5ecf26a8ef59f1585e1bf25 (patch) | |
tree | 848a953c4bf2794407af07fc140ab9e143ca85ce /mpm/python/usrp_mpm | |
parent | 444e26cb301537d9b87687c08bd5ec69d9b6e69d (diff) | |
download | uhd-b89f76bd4d7936e2a5ecf26a8ef59f1585e1bf25.tar.gz uhd-b89f76bd4d7936e2a5ecf26a8ef59f1585e1bf25.tar.bz2 uhd-b89f76bd4d7936e2a5ecf26a8ef59f1585e1bf25.zip |
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
Diffstat (limited to 'mpm/python/usrp_mpm')
-rw-r--r-- | mpm/python/usrp_mpm/periph_manager/n3xx.py | 11 |
1 files changed, 7 insertions, 4 deletions
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) ########################################################################### |