From 100942fb90deb8d927c166debc8f55908ea3a77c Mon Sep 17 00:00:00 2001 From: Hugo Levy-Falk Date: Mon, 6 May 2019 23:30:37 +0200 Subject: [PATCH] absolute path for configuration --- mac_ip.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mac_ip.py b/mac_ip.py index e64b220..29f9d2a 100644 --- a/mac_ip.py +++ b/mac_ip.py @@ -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')