avoid crashing build if metrics is missing cw data

This commit is contained in:
Jérôme Charaoui 2024-06-20 10:13:44 -04:00
parent a500633866
commit da14b84743
No known key found for this signature in database
GPG Key ID: 69C52F658E988542

View File

@ -35,6 +35,9 @@ class CommunityGoodBadIspsPlugin(Plugin):
if "as" not in relay.keys():
warnings.warn("Missing 'as' key for relay %s" % relay["nickname"])
break
if "consensus_weight_fraction" not in relay.keys():
warnings.warn("Missing 'consensus_weight_fraction' key for relay %s" % relay["nickname"])
break
asn = relay["as"]
if asn not in asn_cw:
asn_cw[asn] = 0