]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[2689] Merge branch 'master' into trac2689
authorJINMEI Tatuya <jinmei@isc.org>
Fri, 22 Feb 2013 18:08:15 +0000 (10:08 -0800)
committerJINMEI Tatuya <jinmei@isc.org>
Fri, 22 Feb 2013 18:08:15 +0000 (10:08 -0800)
fixed Conflicts:
src/bin/stats/stats.py.in
(some tests current fail; will fix them)

1  2 
src/bin/stats/stats.py.in

index cfd7ad899b473715f08944ed3d80d7b19922a0ac,9ace6c83e1097a7c0dab16ddae9be42ebc2fc570..51bbf96c497f337f989a5839f4ac5e25a13a2227
@@@ -267,40 -251,45 +267,38 @@@ class Stats
          # It counts the number of instances of same module by
          # examining the third value from the array result of
          # 'show_processes' of Init
 -        try:
 -            value = self.mccs.rpc_call('show_processes', 'Init')
 -        except isc.config.RPCRecipientMissing:
 -            # This has been SessionTimeout before, so we keep the original
 -            # behavior.
 -            raise
 -        except isc.config.RPCError:
 -            # TODO: Is it OK to just pass? As part of refactoring, preserving
 -            # the original behaviour.
 -            value = None
 +        seq = self.cc_session.group_sendmsg(
 +            isc.config.ccsession.create_command("show_processes"), 'Init')
 +        (answer, env) = self.cc_session.group_recvmsg(False, seq)
          modules = []
-         if answer:
-             (rcode, value) = isc.config.ccsession.parse_answer(answer)
-             if rcode == 0 and type(value) is list:
-                 # NOTE: For example, the "show_processes" command
-                 # of Init is assumed to return the response in this
-                 # format:
-                 #  [
-                 #  ...
-                 #    [
-                 #      20061,
-                 #      "b10-auth",
-                 #      "Auth"
-                 #    ],
-                 #    [
-                 #      20103,
-                 #      "b10-auth-2",
-                 #      "Auth"
-                 #    ]
-                 #  ...
-                 #  ]
-                 # If multiple instances of the same module are
-                 # running, the address names of them, which are at the
-                 # third element, must be also same. Thus, the value of
-                 # the third element of each outer element is read here
-                 # for counting multiple instances.  This is a
-                 # workaround for counting the instances. This should
-                 # be fixed in another proper way in the future
-                 # release.
-                 modules = [ v[2] if type(v) is list and len(v) > 2 \
-                                 else None for v in value ]
+         if type(value) is list:
+             # NOTE: For example, the "show_processes" command
+             # of Init is assumed to return the response in this
+             # format:
+             #  [
+             #  ...
+             #    [
+             #      20061,
+             #      "b10-auth",
+             #      "Auth"
+             #    ],
+             #    [
+             #      20103,
+             #      "b10-auth-2",
+             #      "Auth"
+             #    ]
+             #  ...
+             #  ]
+             # If multiple instances of the same module are
+             # running, the address names of them, which are at the
+             # third element, must be also same. Thus, the value of
+             # the third element of each outer element is read here
+             # for counting multiple instances.  This is a
+             # workaround for counting the instances. This should
+             # be fixed in another proper way in the future
+             # release.
+             modules = [ v[2] if type(v) is list and len(v) > 2 \
+                             else None for v in value ]
          # start requesting each module to collect statistics data
          sequences = []
          for (module_name, data) in self.get_statistics_data().items():