mirror of
https://github.com/LibreQoE/LibreQoS.git
synced 2025-02-25 18:55:32 -06:00
Add warnings, try to troubleshoot issue 273
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
from pythonCheck import checkPythonVersion
|
||||
checkPythonVersion()
|
||||
import requests
|
||||
import warnings
|
||||
from ispConfig import excludeSites, findIPv6usingMikrotik, bandwidthOverheadFactor, exceptionCPEs, splynx_api_key, splynx_api_secret, splynx_api_url
|
||||
from integrationCommon import isIpv4Permitted
|
||||
import base64
|
||||
@@ -49,6 +50,8 @@ def getRouters(headers):
|
||||
for router in data:
|
||||
routerID = router['id']
|
||||
ipForRouter[routerID] = router['ip']
|
||||
|
||||
print("Router IPs found: " + str(len(ipForRouter)))
|
||||
return ipForRouter
|
||||
|
||||
def combineAddress(json):
|
||||
@@ -92,12 +95,14 @@ def createShaper():
|
||||
ipv6 = ''
|
||||
routerID = serviceJson['router_id']
|
||||
# If not "Taking IPv4" (Router will assign IP), then use router's set IP
|
||||
if isinstance(serviceJson['taking_ipv4'], str):
|
||||
taking_ipv4 = int(serviceJson['taking_ipv4'])
|
||||
else:
|
||||
taking_ipv4 = serviceJson['taking_ipv4']
|
||||
# Debug
|
||||
taking_ipv4 = int(serviceJson['taking_ipv4'])
|
||||
if taking_ipv4 == 0:
|
||||
ipv4 = ipForRouter[routerID]
|
||||
try:
|
||||
ipv4 = ipForRouter[routerID]
|
||||
except:
|
||||
warnings.warn("taking_ipv4 was 0 for client " + combinedId + " but router ID was not found in ipForRouter", stacklevel=2)
|
||||
ipv4 = ''
|
||||
elif taking_ipv4 == 1:
|
||||
ipv4 = serviceJson['ipv4']
|
||||
|
||||
|
||||
Reference in New Issue
Block a user