]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[2884] do not reuse the string of format
authorNaoki Kambe <kambe@jprs.co.jp>
Wed, 3 Jul 2013 04:24:38 +0000 (13:24 +0900)
committerNaoki Kambe <kambe@jprs.co.jp>
Wed, 3 Jul 2013 06:44:28 +0000 (15:44 +0900)
for avoiding an unexpected behavior if '%s' or some special character for
python formatting is included in the examined string.

src/lib/python/isc/statistics/counters.py

index d83b171ba46a2a06c9b50f4a4eeda02cacdba4c7..5d47f988e408ecab37495df826fe9fa6c318d4a8 100644 (file)
@@ -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