1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00
This commit is contained in:
jeremystretch
2022-07-07 12:48:44 -04:00
parent 1beb8522b9
commit 9a7f3f8c1a
17 changed files with 169 additions and 170 deletions

View File

@ -438,9 +438,9 @@ class Rack(NetBoxModel):
peer for peer in powerfeed.link_peers if isinstance(peer, PowerPort)
])
allocated_draw = 0
for powerport in powerports:
allocated_draw += powerport.get_power_draw()['allocated']
allocated_draw = sum([
powerport.get_power_draw()['allocated'] for powerport in powerports
])
return int(allocated_draw / available_power_total * 100)