From: Naoki Kambe Date: Wed, 3 Jul 2013 04:24:38 +0000 (+0900) Subject: [2884] do not reuse the string of format X-Git-Tag: bind10-1.2.0beta1-release~358^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8288bf44eb68ee5f7f098beeff11e9372065b757;p=thirdparty%2Fkea.git [2884] do not reuse the string of format for avoiding an unexpected behavior if '%s' or some special character for python formatting is included in the examined string. --- diff --git a/src/lib/python/isc/statistics/counters.py b/src/lib/python/isc/statistics/counters.py index d83b171ba4..5d47f988e4 100644 --- a/src/lib/python/isc/statistics/counters.py +++ b/src/lib/python/isc/statistics/counters.py @@ -412,9 +412,8 @@ class Counters(): for cls in zones.keys(): for zone in zones[cls].keys(): for (attr, val) in zones[cls][zone].items(): - id_str = '%s/%%s/%s' % (cls, attr) - id_str1 = id_str % zone - id_str2 = id_str % self._entire_server + id_str1 = '%s/%s/%s' % (cls, zone, attr) + id_str2 = '%s/%s/%s' % (cls, self._entire_server, attr) _set_counter(zones_data, zones_spec, id_str1, val) _inc_counter(zones_data, zones_spec, id_str2, val) # insert entire-server counts