From: Naoki Kambe Date: Tue, 24 Jul 2012 07:23:31 +0000 (+0900) Subject: [2136] Removed 'trees' argument from 'getstats' command X-Git-Tag: trac2351_base~112^2~33 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=be7020b5461d37bbb95abfe84c78c797b80766e8;p=thirdparty%2Fkea.git [2136] Removed 'trees' argument from 'getstats' command --- diff --git a/src/bin/stats/stats.py.in b/src/bin/stats/stats.py.in index 7e72aa358c..34f255577a 100755 --- a/src/bin/stats/stats.py.in +++ b/src/bin/stats/stats.py.in @@ -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) diff --git a/src/bin/stats/tests/test_utils.py b/src/bin/stats/tests/test_utils.py index 73a49d313e..fcb7fc4bce 100644 --- a/src/bin/stats/tests/test_utils.py +++ b/src/bin/stats/tests/test_utils.py @@ -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):