absolute path for configuration
This commit is contained in:
parent
eac5407780
commit
100942fb90
1 changed files with 4 additions and 1 deletions
|
@ -19,6 +19,7 @@
|
||||||
Creates the nat set.
|
Creates the nat set.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
import os
|
||||||
import logging
|
import logging
|
||||||
from configparser import ConfigParser
|
from configparser import ConfigParser
|
||||||
|
|
||||||
|
@ -26,8 +27,10 @@ from re2oapi import Re2oAPIClient
|
||||||
|
|
||||||
from firewall import NetfilterSet
|
from firewall import NetfilterSet
|
||||||
|
|
||||||
|
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||||
|
|
||||||
CONFIG = ConfigParser()
|
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_hostname = CONFIG.get('Re2o', 'hostname')
|
||||||
api_password = CONFIG.get('Re2o', 'password')
|
api_password = CONFIG.get('Re2o', 'password')
|
||||||
|
|
Loading…
Reference in a new issue