aboutsummaryrefslogtreecommitdiffstats
path: root/mpm/python/usrp_mpm/rpc_server.py
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2019-11-08 10:53:40 -0800
committerMartin Braun <martin.braun@ettus.com>2019-11-26 12:21:33 -0800
commitd60e4d87d8e83cc7810af2b8a9e01147096b3475 (patch)
tree9f324ad198b8aaa036c257049956dfd4dd1bfdd5 /mpm/python/usrp_mpm/rpc_server.py
parentec488d49c04aab347ebdfa0da3e516fc34610b0b (diff)
downloaduhd-d60e4d87d8e83cc7810af2b8a9e01147096b3475.tar.gz
uhd-d60e4d87d8e83cc7810af2b8a9e01147096b3475.tar.bz2
uhd-d60e4d87d8e83cc7810af2b8a9e01147096b3475.zip
mpm: Clean up code, improve Pylint score
Many small cleanups: - Fix copyright headers - Fix superfluous imports - Pull some constants out of classes where appropriate - Fix formatting - Improve/fix some docstrings - Disable specific Pylint warnings where appropriate - Global catches use BaseException instead of Exception - Don't use len() for empty checks - Make sure to declare all self attributes in __init__ (note: this is particularly of interest for E310, becuase its regular init happens outside of __init__) - Compacted some E310 code that had multi-DB checks
Diffstat (limited to 'mpm/python/usrp_mpm/rpc_server.py')
-rw-r--r--mpm/python/usrp_mpm/rpc_server.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/mpm/python/usrp_mpm/rpc_server.py b/mpm/python/usrp_mpm/rpc_server.py
index 17179f04d..1dc9d7065 100644
--- a/mpm/python/usrp_mpm/rpc_server.py
+++ b/mpm/python/usrp_mpm/rpc_server.py
@@ -286,7 +286,7 @@ class MPMServer(RPCServer):
self._state.claim_status.value = True
self.periph_manager.claimed = True
self.periph_manager.claim()
- if self.periph_manager.clear_rpc_method_registry_on_unclaim:
+ if self.periph_manager.clear_rpc_registry_on_unclaim:
self._init_rpc_calls(self.periph_manager)
self._state.lock.release()
self.session_id = session_id + " ({})".format(self.client_host)
@@ -339,14 +339,14 @@ class MPMServer(RPCServer):
self._state.claim_status.value = False
self._state.claim_token.value = b''
self.session_id = None
- if self.periph_manager.clear_rpc_method_registry_on_unclaim:
+ if self.periph_manager.clear_rpc_registry_on_unclaim:
self.clear_method_registry()
try:
self.periph_manager.claimed = False
self.periph_manager.unclaim()
self.periph_manager.set_connection_type(None)
self.periph_manager.deinit()
- except Exception as ex:
+ except BaseException as ex:
self._last_error = str(ex)
self.log.error("deinit() failed: %s", str(ex))
# Don't want to propagate this failure -- the session is over