From eec25791a5b090cbf15daef567262326012dc89b Mon Sep 17 00:00:00 2001 From: Job Evers-Meltzer Date: Fri, 30 Dec 2016 16:47:50 -0600 Subject: [PATCH 1/2] fix lbryid in settings dict The lbryid is stored as raw bytes, need to hexlify it before sending it over to the client --- lbrynet/lbrynet_daemon/Daemon.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lbrynet/lbrynet_daemon/Daemon.py b/lbrynet/lbrynet_daemon/Daemon.py index b7d1a81e4..fbc1f5772 100644 --- a/lbrynet/lbrynet_daemon/Daemon.py +++ b/lbrynet/lbrynet_daemon/Daemon.py @@ -1235,7 +1235,9 @@ class Daemon(AuthJSONRPCServer): """ log.info("Get daemon settings") - return self._render_response(conf.settings.get_dict(), OK_CODE) + settings_dict = conf.settings.get_dict() + settings_dict['lbryid'] = binascii.hexlify(settings_dict['lbryid']) + return self._render_response(settings_dict, OK_CODE) @AuthJSONRPCServer.auth_required def jsonrpc_set_settings(self, p): From e823bb201240261cf9995c3a791e867c15e31f5b Mon Sep 17 00:00:00 2001 From: Job Evers-Meltzer Date: Fri, 30 Dec 2016 16:48:44 -0600 Subject: [PATCH 2/2] Bug fix in auth.server Fixes a mistake in fa8190356ad22ffeba1947793aaab17085e08ebe, where an usage of _log_and_render_error was overlooked --- lbrynet/lbrynet_daemon/auth/server.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lbrynet/lbrynet_daemon/auth/server.py b/lbrynet/lbrynet_daemon/auth/server.py index 959a22830..7779fd9d2 100644 --- a/lbrynet/lbrynet_daemon/auth/server.py +++ b/lbrynet/lbrynet_daemon/auth/server.py @@ -312,8 +312,8 @@ class AuthJSONRPCServer(AuthorizedBase): self._set_headers(request, encoded_message, auth_required) self._render_message(request, encoded_message) except Exception as err: - msg = "Failed to render API response: %s" - self._log_and_render_error(err, request, message=msg, version=version) + log.exception("Failed to render API response: %s", result) + self._render_error(err, request, version) def _render_response(self, result, code): return defer.succeed({'result': result, 'code': code})