aboutsummaryrefslogtreecommitdiff
path: root/iploc.py
diff options
context:
space:
mode:
authorPaul Sokolovsky <paul.sokolovsky@linaro.org>2014-03-27 22:46:28 +0200
committerPaul Sokolovsky <paul.sokolovsky@linaro.org>2014-03-28 01:37:28 +0200
commit869a031bfa4ff8cf14646df05c2a7dcd9e0de8a1 (patch)
tree592d35f82fe007f26bd7a9119e6ef9a9ed367d1d /iploc.py
parentbbf997eafaa3f40cc2278bd784636b77b6b716c5 (diff)
iploc: Use IP2Location_cached.py
Change-Id: Ic0cee6ccaa262312bcc10111f13c0f6f81e5de85
Diffstat (limited to 'iploc.py')
-rw-r--r--iploc.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/iploc.py b/iploc.py
index 3b6085a..b88e36c 100644
--- a/iploc.py
+++ b/iploc.py
@@ -1,7 +1,8 @@
#!/usr/bin/python
# Usage: iploc.py </path/to/log> </path/to/output>
-import IP2Location
+#import IP2Location
+import IP2Location_cached as IP2Location
import atexit
import fileinput
import re
@@ -80,6 +81,7 @@ def main(file_names):
IP2LocObj = IP2Location.IP2Location()
IP2LocObj.open(get_path(config["LOC_DB_FILE"]))
+ IP2LocObj.load_index()
REVERSE_DNS_DB.open(get_path(config["DNSHISTORY_DB"]), dbtype=db.DB_BTREE)
atexit.register(REVERSE_DNS_DB.close)