BIND 10 trac2922, updated. 040d3cdfe51996776cdc65fd30e887a45ad89b2a [2822] Provide the members of group/MsgQ

BIND 10 source code commits bind10-changes at lists.isc.org
Wed May 29 14:38:00 UTC 2013


The branch, trac2922 has been updated
       via  040d3cdfe51996776cdc65fd30e887a45ad89b2a (commit)
      from  84d7b7a1804acdb5eeaf96b36940676227856110 (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 040d3cdfe51996776cdc65fd30e887a45ad89b2a
Author: Michal 'vorner' Vaner <vorner at vorner.cz>
Date:   Wed May 29 16:37:43 2013 +0200

    [2822] Provide the members of group/MsgQ

-----------------------------------------------------------------------

Summary of changes:
 src/bin/msgq/msgq.py.in         |   14 +++++++++++++-
 src/bin/msgq/tests/msgq_test.py |    4 ++--
 2 files changed, 15 insertions(+), 3 deletions(-)

-----------------------------------------------------------------------
diff --git a/src/bin/msgq/msgq.py.in b/src/bin/msgq/msgq.py.in
index bd77cf2..24192dd 100755
--- a/src/bin/msgq/msgq.py.in
+++ b/src/bin/msgq/msgq.py.in
@@ -807,7 +807,19 @@ class MsgQ:
             if not self.running:
                 return
 
-            # TODO: Any commands go here
+            # TODO: Who does validation? The ModuleCCSession or must we?
+
+            if command == 'members':
+                # List all members of MsgQ or of a group.
+                if args is None:
+                    args = {}
+                group = args.get('group')
+                if group:
+                    return isc.config.create_answer(0,
+                        list(map(lambda sock: self.fd_to_lname[sock.fileno()],
+                                 self.subs.find(group, ''))))
+                else:
+                    return isc.config.create_answer(0, 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 5ae10d9..b9aaec1 100644
--- a/src/bin/msgq/tests/msgq_test.py
+++ b/src/bin/msgq/tests/msgq_test.py
@@ -218,8 +218,8 @@ class MsgQTest(unittest.TestCase):
             any order).
             """
             array = result['result'][1]
-            self.assertEqual(set(['first', 'second']), array)
-            self.assertEqual({'result': [0, array]}, array)
+            self.assertEqual(set(['first', 'second']), set(array))
+            self.assertEqual({'result': [0, array]}, 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