]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[2136] Removed 'trees' argument from 'getstats' command
authorNaoki Kambe <kambe@jprs.co.jp>
Tue, 24 Jul 2012 07:23:31 +0000 (16:23 +0900)
committerNaoki Kambe <kambe@jprs.co.jp>
Wed, 8 Aug 2012 12:06:28 +0000 (21:06 +0900)
src/bin/stats/stats.py.in
src/bin/stats/tests/test_utils.py

index 7e72aa358ceee14601cf48f4afeceba2141a7f9f..34f255577ac2bc3a4f61a8d233f1f5ea48c14faf 100755 (executable)
@@ -174,9 +174,8 @@ class Stats:
     def do_polling(self):
         """Polls modules for statistics data. Return nothing. First
            search multiple instances of same module. Second requests
-           each module to invoke 'getstats' with a 'trees' argument.
-           Finally updates internal statistics data every time it gets
-           from each instance."""
+           each module to invoke 'getstats'. Finally updates internal
+           statistics data every time it gets from each instance."""
 
         # count the number of instances of same module by examing
         # 'components' of Boss via ConfigManager
@@ -200,7 +199,7 @@ class Stats:
             logger.debug(DBG_STATS_MESSAGING, STATS_SEND_STATISTICS_REQUEST,
                          module_name)
             cmd = isc.config.ccsession.create_command(
-                "getstats", {'trees': [k for k in data.keys()]})
+                "getstats", None) # no argument
             seq = self.cc_session.group_sendmsg(cmd, module_name)
             sequences.append((module_name, seq))
             cnt = modules.count(module_name)
index 73a49d313e050f81b41e08bce31b897f106397fb..fcb7fc4bce3fad898f27feec63533416e38c89db 100644 (file)
@@ -273,15 +273,8 @@ class MockBoss:
         self._started.set()
         self.got_command_name = command
         sdata = self.statistics_data
-        params = { "owner": "Boss",
-                   "data": sdata
-                   }
         if command == 'getstats':
-            notfound = [ t for t in args[0]['trees'] if t not in sdata ]
-            if notfound:
-                return isc.config.create_answer(1, notfound)
-            return isc.config.create_answer(
-                0, dict([(t,sdata[t]) for t in args[0]['trees'] if t in sdata ]))
+            return isc.config.create_answer(0, self.statistics_data)
         elif command == 'show_processes':
             # Return dummy pids
             return isc.config.create_answer(
@@ -410,11 +403,7 @@ class MockAuth:
                        'queries.udp': self.queries_udp,
                        'queries.perzone' : self.queries_per_zone }
         if command == 'getstats':
-            notfound = [ t for t in args[0]['trees'] if t not in sdata ]
-            if notfound:
-                return isc.config.create_answer(1, notfound)
-            return isc.config.create_answer(
-                0, dict([(t,sdata[t]) for t in args[0]['trees'] if t in sdata ]))
+            return isc.config.create_answer(0, sdata)
         return isc.config.create_answer(1, "Unknown Command")
 
 class MyStats(stats.Stats):