Add files via upload

This commit is contained in:
rchac 2020-10-05 01:22:45 -06:00 committed by GitHub
parent 96ea32139e
commit 0ed68c044d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 5 deletions

View File

@ -88,7 +88,8 @@ def refreshShapers():
#clientsList.append((100, '100.65.1.1'))
#Bring in clients from UCRM if enabled
shapableDevices.extend(pullUNMSDevices())
if importFromUNMS:
shapableDevices.extend(pullUNMSDevices())
#Categorize Clients By IPv4 /16
listOfSlash16SubnetsInvolved = []

View File

@ -38,7 +38,7 @@ def pullUNMSDevices():
#print(jsonData)
unmsDevicesToImport = []
for unmsClientSite in jsonData:
try:
if (unmsClientSite['identification']['status'] == 'active') and (unmsClientSite['qos']['downloadSpeed']) and (unmsClientSite['qos']['uploadSpeed']):
downloadSpeedMbps = int(round(unmsClientSite['qos']['downloadSpeed']/1000000))
uploadSpeedMbps = int(round(unmsClientSite['qos']['uploadSpeed']/1000000))
address = unmsClientSite['description']['address']
@ -53,7 +53,7 @@ def pullUNMSDevices():
if '/' in deviceIP:
deviceIP = deviceIP.split('/')[0]
if deviceModel not in deviceModelBlacklist:
print("Added " + deviceModel + ":\t" + deviceName)
print("Added " + ":\t" + deviceName)
thisShapedDevice = {
"identification": {
"name": deviceName,
@ -73,8 +73,8 @@ def pullUNMSDevices():
}
unmsDevicesToImport.append(thisShapedDevice)
print("Imported " + address)
except:
print("Failed to import devices from customer at " + unmsClientSite['description']['address'])
else:
print("Failed to import devices from " + unmsClientSite['description']['address'] + ". Missing QoS.")
return unmsDevicesToImport
def getUNMSdevicesAtClientSite(siteID):