From 316698017f35074e5e5bd89780223807eed8709d Mon Sep 17 00:00:00 2001 From: Leonardo Date: Wed, 19 May 2010 19:36:17 +0200 Subject: [PATCH] Evitiamo errori di ipcalc. --- pywhoisd.db | 9 ++++++++- pywhoisd.py | 7 +++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/pywhoisd.db b/pywhoisd.db index 8eb7c14..e7aad32 100644 --- a/pywhoisd.db +++ b/pywhoisd.db @@ -44,6 +44,7 @@ net 6.0.0.0/8 { ns = 6.20.10.1, 6.22.22.22; }; + domain leo.gnet { name = Leo Gnet; owner = Leonardo Robol ; @@ -56,6 +57,12 @@ domain ineff.gnet { ns = 6.20.10.1; }; +domain gio.gnet { + name = Giovanni gnet; + owner = Giovanni Mascellani ; + ns = 6.22.22.22; +}; + domain lf.gnet { name = Luca GNet; owner = Luca Freschi ; @@ -66,4 +73,4 @@ domain gnet { name = GNET; owner = Undefined; ns = 6.20.10.1, 6.22.22.22; -}; \ No newline at end of file +}; diff --git a/pywhoisd.py b/pywhoisd.py index 244928e..5adaeaa 100755 --- a/pywhoisd.py +++ b/pywhoisd.py @@ -23,8 +23,11 @@ def get_net_of_ip(ip): """ interesting_networks = [] for (address, net) in ip_database.items(): - if IP(ip) in Network(address): - interesting_networks.append (address) + try: + if IP(ip) in Network(address): + interesting_networks.append (address) + except: + continue return interesting_networks def format_output(field, value): -- 2.1.4