From 411996f78486a80c05679929dedc6c5945e2dfd1 Mon Sep 17 00:00:00 2001 From: Ivaylo Novakov Date: Fri, 11 Feb 2022 13:47:00 +0100 Subject: [PATCH] If we can't detect nginx's IP and we're bound to fail the task we don't need to go on. --- setup-scripts/blocklist-airtable.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/setup-scripts/blocklist-airtable.py b/setup-scripts/blocklist-airtable.py index 9ec81952..d59c934e 100755 --- a/setup-scripts/blocklist-airtable.py +++ b/setup-scripts/blocklist-airtable.py @@ -126,6 +126,10 @@ async def block_skylinks_from_airtable(): "docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' nginx" ) + if ipaddress == "": + print("Nginx's IP could not be detected. Exiting.") + return + print("Sending blocklist request to siad through nginx") response = requests.post( "http://" + ipaddress + ":8000/skynet/blocklist",