From db43af19de9a7e4d50cf943a84118eb779489b9b Mon Sep 17 00:00:00 2001 From: Yuval Adam <_@yuv.al> Date: Fri, 12 Oct 2018 09:52:17 +0200 Subject: Don't bork on unknown fields --- app.py | 1 + whois.py | 1 + 2 files changed, 2 insertions(+) diff --git a/app.py b/app.py index de3e70a..6b406ea 100644 --- a/app.py +++ b/app.py @@ -9,6 +9,7 @@ env = 'PROD' if 'PROD' in environ else 'DEV' TEMPLATE = ''' /----------------------------------------\\ | {ip:39}| +| | | {route:39}| | {origin:39}| | {descr:39}| diff --git a/whois.py b/whois.py index 2681db0..be98034 100644 --- a/whois.py +++ b/whois.py @@ -4,6 +4,7 @@ def extract_field(field, response): for line in response: if line.startswith(field): return line.split(' ')[-1].strip() + return 'Unknown' def whois(ip): cp = run(['whois', ip], capture_output=True) -- cgit v1.3.1