Browse Source

[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.
Naoki Kambe 12 years ago
parent
commit
8288bf44eb
1 changed files with 2 additions and 3 deletions
  1. 2 3
      src/lib/python/isc/statistics/counters.py

+ 2 - 3
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