Skip to content

Commit

Permalink
fix: details as None
Browse files Browse the repository at this point in the history
  • Loading branch information
kiraum committed May 17, 2024
1 parent 578e063 commit 4e57d0f
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 9 deletions.
2 changes: 1 addition & 1 deletion peering_gossip.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
Peering Gossip - Gossiping about bad practices!
"""

import asyncio
import argparse
import asyncio
import sys

from pgossip.pgossip import PGossip
Expand Down
12 changes: 10 additions & 2 deletions pgossip/pgossip.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,16 @@ async def get_asn_details(self, asn, pfxs):
"country": {"iso": "NL"},
}

if not details.get("asnName"):
details["asnName"] = "NA"
if details:
if not details.get("asnName"):
details["asnName"] = "NA"
else:
details = {
"asnName": "NA",
"rank": "NA",
"source": "NA",
"country": {"iso": "NA"},
}

return (
f"{pfxs} | {asn} | {details['asnName']} | {details['rank']} | {details['source']} | {details['country']['iso']} "
Expand Down
2 changes: 1 addition & 1 deletion reports/alice-rs.linx.net.json
Original file line number Diff line number Diff line change
Expand Up @@ -944,4 +944,4 @@
"Country": "GB",
"PeeringDB link": "https://www.peeringdb.com/asn/39356"
}
]
]
2 changes: 1 addition & 1 deletion reports/alice-rs.linx.net.txt
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,4 @@ Filtered prefixes @ https://alice-rs.linx.net | ASN | AS-NAME | AS Rank | Source
2 | 3741 | IS | 289 | AFRINIC | ZA | https://www.peeringdb.com/asn/3741
2 | 206078 | UltraNetworks | 10199 | RIPE | GB | https://www.peeringdb.com/asn/206078
1 | 13237 | LAMBDANET-AS | 174 | RIPE | DE | https://www.peeringdb.com/asn/13237
1 | 39356 | Avanti-UK-AS | 4657 | RIPE | GB | https://www.peeringdb.com/asn/39356
1 | 39356 | Avanti-UK-AS | 4657 | RIPE | GB | https://www.peeringdb.com/asn/39356
2 changes: 1 addition & 1 deletion reports/lg.ams-ix.net.json
Original file line number Diff line number Diff line change
Expand Up @@ -134,4 +134,4 @@
"Country": "IN",
"PeeringDB link": "https://www.peeringdb.com/asn/132770"
}
]
]
2 changes: 1 addition & 1 deletion reports/lg.ams-ix.net.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ Filtered prefixes @ https://lg.ams-ix.net | ASN | AS-NAME | AS Rank | Source | C
2 | 64567 | Private ASN | NA | NA | NL | https://www.peeringdb.com/asn/64567
2 | 36351 | SOFTLAYER | 1921 | ARIN | US | https://www.peeringdb.com/asn/36351
2 | 55352 | MCPL-IN | 677 | APNIC | IN | https://www.peeringdb.com/asn/55352
2 | 132770 | GAZON-AS-IN | 467 | APNIC | IN | https://www.peeringdb.com/asn/132770
2 | 132770 | GAZON-AS-IN | 467 | APNIC | IN | https://www.peeringdb.com/asn/132770
2 changes: 1 addition & 1 deletion reports/lg.de-cix.net.json
Original file line number Diff line number Diff line change
Expand Up @@ -5489,4 +5489,4 @@
"Country": "CH",
"PeeringDB link": "https://www.peeringdb.com/asn/44938"
}
]
]
2 changes: 1 addition & 1 deletion reports/lg.de-cix.net.txt
Original file line number Diff line number Diff line change
Expand Up @@ -608,4 +608,4 @@ Filtered prefixes @ https://lg.de-cix.net | ASN | AS-NAME | AS Rank | Source | C
1 | 213138 | alfanetwork | 9747 | RIPE | ES | https://www.peeringdb.com/asn/213138
1 | 19689 | MST-AS | 16244 | ARIN | US | https://www.peeringdb.com/asn/19689
1 | 22422 | BOARD-OF-ELECTIONS-IN-THE-CITY-OF-NEW-YORK | 25819 | ARIN | US | https://www.peeringdb.com/asn/22422
1 | 44938 | ITESYS-AS | 35451 | RIPE | CH | https://www.peeringdb.com/asn/44938
1 | 44938 | ITESYS-AS | 35451 | RIPE | CH | https://www.peeringdb.com/asn/44938

0 comments on commit 4e57d0f

Please sign in to comment.