diff --git a/peering_gossip.py b/peering_gossip.py index ab6b6eb..6ec3667 100755 --- a/peering_gossip.py +++ b/peering_gossip.py @@ -3,8 +3,8 @@ Peering Gossip - Gossiping about bad practices! """ -import asyncio import argparse +import asyncio import sys from pgossip.pgossip import PGossip diff --git a/pgossip/pgossip.py b/pgossip/pgossip.py index d0551a5..ded0c4a 100644 --- a/pgossip/pgossip.py +++ b/pgossip/pgossip.py @@ -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']} " diff --git a/reports/alice-rs.linx.net.json b/reports/alice-rs.linx.net.json index 3e7b224..1421dd0 100644 --- a/reports/alice-rs.linx.net.json +++ b/reports/alice-rs.linx.net.json @@ -944,4 +944,4 @@ "Country": "GB", "PeeringDB link": "https://www.peeringdb.com/asn/39356" } -] \ No newline at end of file +] diff --git a/reports/alice-rs.linx.net.txt b/reports/alice-rs.linx.net.txt index 213719d..043c3ef 100644 --- a/reports/alice-rs.linx.net.txt +++ b/reports/alice-rs.linx.net.txt @@ -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 \ No newline at end of file +1 | 39356 | Avanti-UK-AS | 4657 | RIPE | GB | https://www.peeringdb.com/asn/39356 diff --git a/reports/lg.ams-ix.net.json b/reports/lg.ams-ix.net.json index 3cadf98..5d8cf44 100644 --- a/reports/lg.ams-ix.net.json +++ b/reports/lg.ams-ix.net.json @@ -134,4 +134,4 @@ "Country": "IN", "PeeringDB link": "https://www.peeringdb.com/asn/132770" } -] \ No newline at end of file +] diff --git a/reports/lg.ams-ix.net.txt b/reports/lg.ams-ix.net.txt index faa8e52..f3bf94b 100644 --- a/reports/lg.ams-ix.net.txt +++ b/reports/lg.ams-ix.net.txt @@ -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 \ No newline at end of file +2 | 132770 | GAZON-AS-IN | 467 | APNIC | IN | https://www.peeringdb.com/asn/132770 diff --git a/reports/lg.de-cix.net.json b/reports/lg.de-cix.net.json index 3cc9d5c..fba4514 100644 --- a/reports/lg.de-cix.net.json +++ b/reports/lg.de-cix.net.json @@ -5489,4 +5489,4 @@ "Country": "CH", "PeeringDB link": "https://www.peeringdb.com/asn/44938" } -] \ No newline at end of file +] diff --git a/reports/lg.de-cix.net.txt b/reports/lg.de-cix.net.txt index bd27b6d..aff2579 100644 --- a/reports/lg.de-cix.net.txt +++ b/reports/lg.de-cix.net.txt @@ -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 \ No newline at end of file +1 | 44938 | ITESYS-AS | 35451 | RIPE | CH | https://www.peeringdb.com/asn/44938