diff --git a/freeradius_utils/auth.py b/freeradius_utils/auth.py index 1607ba05..5254c22f 100644 --- a/freeradius_utils/auth.py +++ b/freeradius_utils/auth.py @@ -40,7 +40,7 @@ from configparser import ConfigParser from re2oapi import Re2oAPIClient import sys -import os +from pathlib import Path import subprocess import logging import traceback @@ -114,10 +114,10 @@ def instantiate(*_): """ logger.info("Instantiation") - path = (os.path.dirname(os.path.abspath(__file__))) + path = Path(__file__).resolve(strict=True).parent config = ConfigParser() - config.read(path+'/config.ini') + config.read(path / 'config.ini') api_hostname = config.get('Re2o', 'hostname') api_password = config.get('Re2o', 'password')