From dfc115f2756ee604d91fc50617945b09fd38ec1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tao=20Bror=20Bojl=C3=A9n?= Date: Thu, 28 Feb 2019 18:05:54 +0000 Subject: [PATCH] lowercase instance names (fix #48) --- backend/scraper/management/commands/scrape.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/scraper/management/commands/scrape.py b/backend/scraper/management/commands/scrape.py index 981c6c3..373afdd 100644 --- a/backend/scraper/management/commands/scrape.py +++ b/backend/scraper/management/commands/scrape.py @@ -76,7 +76,8 @@ class Command(BaseCommand): if response.status_code != 200 or not isinstance(peers, list) or get_key(peers, ['error']): raise InvalidResponseException("Could not get peers for {}".format(instance_name)) # Get rid of peers that just say "null" and the instance itself - return [peer for peer in peers if peer and peer != instance_name] + # Also make sure to lowercase all instance names; otherwise there'll be some duplicates + return [peer.lower() for peer in peers if peer and peer != instance_name] @staticmethod def get_statuses(instance_name: str):