diff options
| author | Yuval Adam <_@yuv.al> | 2018-10-12 09:52:17 +0200 |
|---|---|---|
| committer | Yuval Adam <_@yuv.al> | 2018-10-12 09:52:17 +0200 |
| commit | db43af19de9a7e4d50cf943a84118eb779489b9b (patch) | |
| tree | 71b45340289d5f00ae940b341e73a420b5262d64 | |
| parent | 3b7428f21fb5e5adb3720644c66d9926f06bfea1 (diff) | |
Don't bork on unknown fields
| -rw-r--r-- | app.py | 1 | ||||
| -rw-r--r-- | whois.py | 1 |
2 files changed, 2 insertions, 0 deletions
@@ -9,6 +9,7 @@ env = 'PROD' if 'PROD' in environ else 'DEV' TEMPLATE = ''' /----------------------------------------\\ | {ip:39}| +| | | {route:39}| | {origin:39}| | {descr:39}| @@ -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) |
