From ae45db9b5baee6eefcc8d46458ac0dbbde12557f Mon Sep 17 00:00:00 2001 From: lalanza808 Date: Thu, 21 Dec 2023 14:05:23 -0800 Subject: [PATCH] [ci skip] fix assumption of 'en' in response --- dockerfiles/nodemapper.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/dockerfiles/nodemapper.py b/dockerfiles/nodemapper.py index eaae82a..5933e3f 100644 --- a/dockerfiles/nodemapper.py +++ b/dockerfiles/nodemapper.py @@ -37,13 +37,14 @@ def nodes(): geo = get_geoip(host) geostr = 'geoip{{latitude="{lat}", longitude="{lon}", country_code="{country_code}", country_name="{country_name}", status="{status}"}} 1' if geostr not in peers: - peers.append(geostr.format( - lat=geo.location.latitude, - lon=geo.location.longitude, - country_code=geo.continent.code, - country_name=geo.continent.names['en'], - status=status - )) + if 'en' in geo.continent.names: + peers.append(geostr.format( + lat=geo.location.latitude, + lon=geo.location.longitude, + country_code=geo.continent.code, + country_name=geo.continent.names['en'], + status=status + )) for peer in peer_list['gray_list']: if peer.get('host'): add_peer(peer['host'], 'gray')