Skip to content

Commit

Permalink
Don't flad ASNs which appeared at the beginning or the end of a path
Browse files Browse the repository at this point in the history
  • Loading branch information
petya-vasileva committed Jan 14, 2025
1 parent 7d9a0db commit 7edff47
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ps-trace_path_changed.py
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,6 @@ def getChanged(baseDf, compare2, updatedbaseLine, altsOfAlts, cricDict, cut):

casns = compare2[compare2['pair'] == name]['asns_updated'].tolist()
asns_expanded = list([j for i in casns for j in i])
counter = collections.Counter(asns_expanded)

flag = False
diff_temp = []
Expand All @@ -461,6 +460,9 @@ def getChanged(baseDf, compare2, updatedbaseLine, altsOfAlts, cricDict, cut):
for d in diff:

if d not in upbase:
if d == asns[0] or d == asns[-1]:
# if the ASN is the first or the last on the path, then it's not an alarm
flag = False
if d in altsOfAlts.keys():
# if none of the alternative ASNs is in the baseline path or the updated baseline list,
# then flag it to True (meaning raise an alarm)
Expand All @@ -473,7 +475,6 @@ def getChanged(baseDf, compare2, updatedbaseLine, altsOfAlts, cricDict, cut):
# there is no need for an alarm
flag = not any(False if alt not in base or alt in upbase else True
for alt in cricDict[d])

else:
flag = True

Expand Down

0 comments on commit 7edff47

Please sign in to comment.