Sfoglia il codice sorgente

15524 round iprange utilization (#15734)

Arthur Hanson 1 anno fa
parent
commit
cbfed83f60
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  1. 1 1
      netbox/ipam/models/ip.py

+ 1 - 1
netbox/ipam/models/ip.py

@@ -692,7 +692,7 @@ class IPRange(PrimaryModel):
             ip.address.ip for ip in self.get_child_ips()
             ip.address.ip for ip in self.get_child_ips()
         ]).size
         ]).size
 
 
-        return int(float(child_count) / self.size * 100)
+        return min(float(child_count) / self.size * 100, 100)
 
 
 
 
 class IPAddress(PrimaryModel):
 class IPAddress(PrimaryModel):