diff --git a/addons/website/models/ir_http.py b/addons/website/models/ir_http.py index bee78eb1cf3..7da212998c8 100644 --- a/addons/website/models/ir_http.py +++ b/addons/website/models/ir_http.py @@ -65,7 +65,7 @@ class ir_http(orm.AbstractModel): import GeoIP # updated database can be downloaded on MaxMind website # http://dev.maxmind.com/geoip/legacy/install/city/ - geofile = config.get('geoip_database', '/usr/share/GeoIP/GeoLiteCity.dat') + geofile = config.get('geoip_database') if os.path.exists(geofile): self.geo_ip_resolver = GeoIP.open(geofile, GeoIP.GEOIP_STANDARD) else: diff --git a/openerp/tools/config.py b/openerp/tools/config.py index 3fb940e1639..0dbc29f8471 100644 --- a/openerp/tools/config.py +++ b/openerp/tools/config.py @@ -282,6 +282,8 @@ class configmanager(object): type="int") group.add_option("--unaccent", dest="unaccent", my_default=False, action="store_true", help="Use the unaccent function provided by the database when available.") + group.add_option("--geoip_db", dest="geoip_database", my_default='/usr/share/GeoIP/GeoLiteCity.dat', action="store_true", + help="Absolute path to the GeoIP database file.") parser.add_option_group(group) if os.name == 'posix':