Skip to content

Commit

Permalink
Use os.path to open the GeoIP.dat file
Browse files Browse the repository at this point in the history
  • Loading branch information
ikoniaris committed Jul 26, 2014
1 parent b10f06f commit 7f4692e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion kippo/dblog/elasticsearch.py
Original file line number Diff line number Diff line change
@@ -5,6 +5,7 @@
import time
import json
import uuid
import os

# This is the ES mapping, we mostly need it to mark specific fields as "not_analyzed"
kippo_mapping = {
@@ -54,7 +55,7 @@ def start(self, cfg):
self.run(cfg)

def run(self, cfg):
self.geoip = GeoIP.open("geoip/GeoIP.dat", GeoIP.GEOIP_STANDARD)
self.geoip = GeoIP.open(os.path.join(os.path.dirname(__file__), "geoip/GeoIP.dat"), GeoIP.GEOIP_STANDARD)
self.es_conn.indices.create_index_if_missing(self.es_index)
self.es_conn.indices.put_mapping(self.es_type, {'properties': kippo_mapping}, [self.es_index])

0 comments on commit 7f4692e

Please sign in to comment.