float() %
authorxchaos <xchaos@251d49ef-1d17-4917-a970-b30cf55b089b>
Wed, 8 May 2013 22:29:31 +0000 (22:29 +0000)
committerxchaos <xchaos@251d49ef-1d17-4917-a970-b30cf55b089b>
Wed, 8 May 2013 22:29:31 +0000 (22:29 +0000)
git-svn-id: https://dev.arachne.cz/repos/prometheus/trunk@226 251d49ef-1d17-4917-a970-b30cf55b089b

optional-tools/hosts-ping.py

index ca19196..b7afd7f 100755 (executable)
@@ -95,7 +95,7 @@ def append_host(html, host, base_url, counter, red_treshold, green_treshold):
     elif host[column] < green_treshold[kolikaty]:
       style[column] += ' color: green;'
   
     elif host[column] < green_treshold[kolikaty]:
       style[column] += ' color: green;'
   
-  loss = 100*host['loss']/host['attempts']
+  loss = float(100*host['loss'])/host['attempts']
   html.write(   ('<tr class="%s"><td style="%s">%d</td><td><a href="%s" target="_blank" class="blue">%s</a></td><td style="%s">%.1f%%</td>' + "\n")
               % (('even', 'odd')[counter % 2], style['right'], counter, base_url % (host['name'], host['smokename']), host['name'], style['loss'], loss))
 
   html.write(   ('<tr class="%s"><td style="%s">%d</td><td><a href="%s" target="_blank" class="blue">%s</a></td><td style="%s">%.1f%%</td>' + "\n")
               % (('even', 'odd')[counter % 2], style['right'], counter, base_url % (host['name'], host['smokename']), host['name'], style['loss'], loss))
 
This page took 0.153903 seconds and 4 git commands to generate.