mirror of
https://github.com/LibreQoE/LibreQoS.git
synced 2025-02-25 18:55:32 -06:00
Merge pull request #329 from LibreQoE/allowOverrideNetworkJSON
Offer toggle to overwrite Network.json on each integration reload. Disabled by default.
This commit is contained in:
commit
27c5ce59bf
@ -3,8 +3,12 @@ checkPythonVersion()
|
||||
import requests
|
||||
import os
|
||||
import csv
|
||||
from ispConfig import uispSite, uispStrategy
|
||||
from integrationCommon import isIpv4Permitted, fixSubnet
|
||||
try:
|
||||
from ispConfig import uispSite, uispStrategy, overwriteNetworkJSONalways
|
||||
except:
|
||||
from ispConfig import uispSite, uispStrategy
|
||||
overwriteNetworkJSONalways = False
|
||||
|
||||
def uispRequest(target):
|
||||
# Sends an HTTP request to UISP and returns the
|
||||
@ -71,7 +75,10 @@ def buildFlatGraph():
|
||||
net.prepareTree()
|
||||
net.plotNetworkGraph(False)
|
||||
if net.doesNetworkJsonExist():
|
||||
print("network.json already exists. Leaving in-place.")
|
||||
if overwriteNetworkJSONalways:
|
||||
net.createNetworkJson()
|
||||
else:
|
||||
print("network.json already exists and overwriteNetworkJSONalways set to False. Leaving in-place.")
|
||||
else:
|
||||
net.createNetworkJson()
|
||||
net.createShapedDevices()
|
||||
@ -362,7 +369,10 @@ def buildFullGraph():
|
||||
net.prepareTree()
|
||||
net.plotNetworkGraph(False)
|
||||
if net.doesNetworkJsonExist():
|
||||
print("network.json already exists. Leaving in-place.")
|
||||
if overwriteNetworkJSONalways:
|
||||
net.createNetworkJson()
|
||||
else:
|
||||
print("network.json already exists and overwriteNetworkJSONalways set to False. Leaving in-place.")
|
||||
else:
|
||||
net.createNetworkJson()
|
||||
net.createShapedDevices()
|
||||
|
@ -63,6 +63,9 @@ influxDBtoken = ""
|
||||
# Use Customer Name or Address as Circuit Name
|
||||
circuitNameUseAddress = True
|
||||
|
||||
# Should integrationUISP overwrite network.json on each run?
|
||||
overwriteNetworkJSONalways = False
|
||||
|
||||
# If a device shows a WAN IP within these subnets, assume they are behind NAT / un-shapable, and ignore them
|
||||
ignoreSubnets = ['192.168.0.0/16']
|
||||
allowedSubnets = ['100.64.0.0/10']
|
||||
|
Loading…
Reference in New Issue
Block a user