absolute path for configuration

This commit is contained in:
Hugo Levy-Falk 2019-05-06 23:30:37 +02:00 committed by root
parent eac5407780
commit 100942fb90

View file

@ -19,6 +19,7 @@
Creates the nat set.
"""
import os
import logging
from configparser import ConfigParser
@ -26,8 +27,10 @@ from re2oapi import Re2oAPIClient
from firewall import NetfilterSet
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
CONFIG = ConfigParser()
CONFIG.read('/usr/local/firewall/config.ini')
CONFIG.read(os.path.join(BASE_DIR, 'config.ini'))
api_hostname = CONFIG.get('Re2o', 'hostname')
api_password = CONFIG.get('Re2o', 'password')