aboutsummaryrefslogtreecommitdiffstats
path: root/mpm/python/usrp_mpm/rpc_server.py
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2017-12-14 14:53:08 -0800
committerMartin Braun <martin.braun@ettus.com>2017-12-22 15:05:58 -0800
commit20160e806199474c8481215236696f16f573ce8a (patch)
tree825bc475e32c58265487e36596da5c52d6bb423b /mpm/python/usrp_mpm/rpc_server.py
parentb260133f4f69e69f9968bcd88979a3c2b489e972 (diff)
downloaduhd-20160e806199474c8481215236696f16f573ce8a.tar.gz
uhd-20160e806199474c8481215236696f16f573ce8a.tar.bz2
uhd-20160e806199474c8481215236696f16f573ce8a.zip
mpm: rpc_server: Fix use of to_binary_str()
Reviewed-By: Brent Stapleton <brent.stapleton@ettus.com>
Diffstat (limited to 'mpm/python/usrp_mpm/rpc_server.py')
-rw-r--r--mpm/python/usrp_mpm/rpc_server.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/mpm/python/usrp_mpm/rpc_server.py b/mpm/python/usrp_mpm/rpc_server.py
index e1e871869..51ba9272b 100644
--- a/mpm/python/usrp_mpm/rpc_server.py
+++ b/mpm/python/usrp_mpm/rpc_server.py
@@ -23,6 +23,7 @@ from builtins import str, bytes
from builtins import range
from mprpc import RPCServer
from usrp_mpm.mpmlog import get_main_logger
+from usrp_mpm.mpmutils import to_binary_str
TIMEOUT_INTERVAL = 3.0 # Seconds before claim expires
TOKEN_LEN = 16 # Length of the token string
@@ -80,11 +81,7 @@ class MPMServer(RPCServer):
- The device is currently claimed
- The claim token matches the one passed in
"""
- try:
- token = bytes(token, 'ascii')
- except TypeError:
- pass
-
+ token = to_binary_str(token)
return self._state.claim_status.value and \
len(token) == TOKEN_LEN and \
self._state.claim_token.value == token