summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuval Adam <_@yuv.al>2018-10-12 09:52:17 +0200
committerYuval Adam <_@yuv.al>2018-10-12 09:52:17 +0200
commitdb43af19de9a7e4d50cf943a84118eb779489b9b (patch)
tree71b45340289d5f00ae940b341e73a420b5262d64
parent3b7428f21fb5e5adb3720644c66d9926f06bfea1 (diff)
Don't bork on unknown fields
-rw-r--r--app.py1
-rw-r--r--whois.py1
2 files changed, 2 insertions, 0 deletions
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)