mirror of
https://github.com/LibreQoE/LibreQoS.git
synced 2025-02-25 18:55:32 -06:00
Force types to be integers in Python
Replace: min(data[node]['downloadBandwidthMbps'],parentMaxDL) With: min(int(data[node]['downloadBandwidthMbps']),int(parentMaxDL)) Python thought my current configuration contained a string for one of the numbers. It was a string representing an int. Force strong typing (a non-numeric will fail, but it would fail anyway).
This commit is contained in:
parent
433e7ac877
commit
24722aa608
@ -545,8 +545,8 @@ def refreshShapers():
|
||||
if isinstance(node, str):
|
||||
if (isinstance(data[node], dict)) and (node != 'children'):
|
||||
# Cap based on this node's max bandwidth, or parent node's max bandwidth, whichever is lower
|
||||
data[node]['downloadBandwidthMbps'] = min(data[node]['downloadBandwidthMbps'],parentMaxDL)
|
||||
data[node]['uploadBandwidthMbps'] = min(data[node]['uploadBandwidthMbps'],parentMaxUL)
|
||||
data[node]['downloadBandwidthMbps'] = min(int(data[node]['downloadBandwidthMbps']),int(parentMaxDL))
|
||||
data[node]['uploadBandwidthMbps'] = min(int(data[node]['uploadBandwidthMbps']),int(parentMaxUL))
|
||||
# Recursive call this function for children nodes attached to this node
|
||||
if 'children' in data[node]:
|
||||
# We need to keep tabs on the minor counter, because we can't have repeating class IDs. Here, we bring back the minor counter from the recursive function
|
||||
|
Loading…
Reference in New Issue
Block a user