BIND 10 trac2922, updated. 40e0617397c03de943d81e05541c4de17885f6f0 [2922] Make sure the result is JSON encodable
BIND 10 source code commits
bind10-changes at lists.isc.org
Thu May 30 07:00:00 UTC 2013
The branch, trac2922 has been updated
via 40e0617397c03de943d81e05541c4de17885f6f0 (commit)
from 33352a6b9af110cb06c40c8cfbecc26b5e3e89c2 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 40e0617397c03de943d81e05541c4de17885f6f0
Author: Michal 'vorner' Vaner <vorner at vorner.cz>
Date: Thu May 30 08:59:42 2013 +0200
[2922] Make sure the result is JSON encodable
-----------------------------------------------------------------------
Summary of changes:
src/bin/msgq/msgq.py.in | 3 ++-
src/bin/msgq/tests/msgq_test.py | 4 ++++
2 files changed, 6 insertions(+), 1 deletion(-)
-----------------------------------------------------------------------
diff --git a/src/bin/msgq/msgq.py.in b/src/bin/msgq/msgq.py.in
index 24192dd..2352099 100755
--- a/src/bin/msgq/msgq.py.in
+++ b/src/bin/msgq/msgq.py.in
@@ -819,7 +819,8 @@ class MsgQ:
list(map(lambda sock: self.fd_to_lname[sock.fileno()],
self.subs.find(group, ''))))
else:
- return isc.config.create_answer(0, self.lnames.keys())
+ return isc.config.create_answer(0,
+ list(self.lnames.keys()))
config_logger.error(MSGQ_COMMAND_UNKNOWN, command)
return isc.config.create_answer(1, 'unknown command: ' + command)
diff --git a/src/bin/msgq/tests/msgq_test.py b/src/bin/msgq/tests/msgq_test.py
index b9aaec1..d79ea8a 100644
--- a/src/bin/msgq/tests/msgq_test.py
+++ b/src/bin/msgq/tests/msgq_test.py
@@ -220,6 +220,10 @@ class MsgQTest(unittest.TestCase):
array = result['result'][1]
self.assertEqual(set(['first', 'second']), set(array))
self.assertEqual({'result': [0, array]}, result)
+ # Make sure the result can be encoded as JSON
+ # (there seems to be types that look like a list but JSON choks
+ # on them)
+ json.dumps(result)
# Members of the G1 and G2
self.assertEqual({'result': [0, ["second"]]},
self.__msgq.command_handler('members',
More information about the bind10-changes
mailing list