]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[2856] Pass tuples in the command queue
authorMukund Sivaraman <muks@isc.org>
Fri, 5 Jul 2013 11:10:32 +0000 (16:40 +0530)
committerMukund Sivaraman <muks@isc.org>
Fri, 5 Jul 2013 11:10:32 +0000 (16:40 +0530)
src/bin/memmgr/memmgr.py.in
src/lib/python/isc/memmgr/builder.py
src/lib/python/isc/memmgr/tests/builder_tests.py

index 5c9040f083080348d34643ab36f556313dc849a4..4bf27fe9a54eb25201e179acc8e19e55c7575559 100755 (executable)
@@ -162,7 +162,7 @@ class Memmgr(BIND10Server):
         # This makes the MemorySegmentBuilder exit its main loop. It
         # should make the builder thread joinable.
         with self._builder_cv:
-            self._builder_command_queue.append('shutdown')
+            self._builder_command_queue.append(('shutdown',))
             self._builder_cv.notify_all()
 
         self._builder_thread.join()
index 317ae4832471cf7180cf7bae68f06e565d768b19..eb196153fe8b8e829abf415f1ad95f93b4066b0f 100644 (file)
@@ -85,7 +85,8 @@ class MemorySegmentBuilder:
                 # Run commands passed in the command queue sequentially
                 # in the given order.  For now, it only supports the
                 # "shutdown" command, which just exits the thread.
-                for command in local_command_queue:
+                for command_tuple in local_command_queue:
+                    command = command_tuple[0]
                     if command == 'shutdown':
                         self.__handle_shutdown()
                         # When the shutdown command is received, we do
index 328fd747c2490df1446d4e431443b0a046cff5e2..94cb8e1e3dc7475b8080ef96f51d345b637bf1df 100644 (file)
@@ -58,7 +58,7 @@ class TestMemorySegmentBuilder(unittest.TestCase):
         # Now that the builder thread is running, send it a bad
         # command. The thread should exit its main loop and be joinable.
         with self._builder_cv:
-            self._builder_command_queue.append('bad_command')
+            self._builder_command_queue.append(('bad_command',))
             self._builder_cv.notify_all()
 
         # Wait 5 seconds to receive a notification on the socket from
@@ -98,10 +98,10 @@ class TestMemorySegmentBuilder(unittest.TestCase):
         # Now that the builder thread is running, send it the shutdown
         # command. The thread should exit its main loop and be joinable.
         with self._builder_cv:
-            self._builder_command_queue.append('shutdown')
+            self._builder_command_queue.append(('shutdown',))
             # Commands after 'shutdown' must be ignored.
-            self._builder_command_queue.append('bad_command_1')
-            self._builder_command_queue.append('bad_command_2')
+            self._builder_command_queue.append(('bad_command_1',))
+            self._builder_command_queue.append(('bad_command_2',))
             self._builder_cv.notify_all()
 
         # Wait 5 seconds at most for the main loop of the builder to