Fix UISP Integration Bug - only use PtMP as parent if one link connects that site

This commit is contained in:
Robert Chacón 2024-04-16 13:38:41 -06:00 committed by GitHub
parent 0c8f40cdbd
commit 513f6eec89
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -336,6 +336,16 @@ def findNodesBranchedOffPtMP(siteList, dataLinks, sites, rootSite, foundAirFiber
if isTrueSite:
if site['parent'] is not None:
parent = site['parent']
# Check how many links connect site to parent
# If only one link conencts them, we can then consdier if it's a node off PtMP
howManyLinksToParent = 0
for link in dataLinks:
if (link['to']['site'] is not None) and (link['to']['site']['identification'] is not None):
if ('identification' in link['to']['site']) and (link['to']['site']['identification'] is not None) and link['from'] is not None and link['from']['site'] is not None and link['from']['site']['identification'] is not None:
if link['from']['site']['identification']['id'] == trueParent:
if link['to']['site']['identification']['id'] == id:
howManyLinksToParent += 1
if howManyLinksToParent == 1:
for link in dataLinks:
if (link['to']['site'] is not None) and (link['to']['site']['identification'] is not None):
if ('identification' in link['to']['site']) and (link['to']['site']['identification'] is not None) and link['from'] is not None and link['from']['site'] is not None and link['from']['site']['identification'] is not None:
@ -356,7 +366,7 @@ def findNodesBranchedOffPtMP(siteList, dataLinks, sites, rootSite, foundAirFiber
}
if usePtMPasParent:
site['parent'] = apID
print('Site ' + name + ' will use PtMP AP as parent.')
print('Site ' + name + ' will use PtMP AP ' + link['from']['device']['identification']['name'] + ' as parent from site ' + link['from']['site']['identification']['name'])
return siteList, nodeOffPtMP
def handleMultipleInternetNodes(sites, dataLinks, uispSite):