aboutsummaryrefslogtreecommitdiffstats
path: root/mpm/python/usrp_mpm/rpc_server.py
diff options
context:
space:
mode:
Diffstat (limited to 'mpm/python/usrp_mpm/rpc_server.py')
-rw-r--r--mpm/python/usrp_mpm/rpc_server.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/mpm/python/usrp_mpm/rpc_server.py b/mpm/python/usrp_mpm/rpc_server.py
index d2635c7c2..271f707e3 100644
--- a/mpm/python/usrp_mpm/rpc_server.py
+++ b/mpm/python/usrp_mpm/rpc_server.py
@@ -66,7 +66,7 @@ class MPMServer(RPCServer):
# add public dboard methods in `db_<slot>_` namespace
for db_slot, dboard in enumerate(mgr.dboards):
self._update_component_commands(dboard, 'db_' + str(db_slot) + '_', '_db_methods')
- super(MPMServer, self).__init__(*args, **kwargs)
+ super(MPMServer, self).__init__(*args, pack_params={'use_bin_type': True}, **kwargs)
def _check_token_valid(self, token):
"""
@@ -74,9 +74,14 @@ class MPMServer(RPCServer):
- The device is currently claimed
- The claim token matches the one passed in
"""
+ try:
+ token = bytes(token, 'ascii')
+ except TypeError:
+ pass
+
return self._state.claim_status.value and \
len(token) == TOKEN_LEN and \
- self._state.claim_token.value == bytes(token, 'ascii')
+ self._state.claim_token.value == token
def _update_component_commands(self, component, namespace, storage):