From 425d47c52d3e8be30e2f7018a93bf614921f5f38 Mon Sep 17 00:00:00 2001 From: chapeau Date: Thu, 13 May 2021 19:31:27 +0200 Subject: [PATCH] merge --- freeradius_utils/auth.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/freeradius_utils/auth.py b/freeradius_utils/auth.py index 7c32f05c..8ad2ca53 100644 --- a/freeradius_utils/auth.py +++ b/freeradius_utils/auth.py @@ -35,6 +35,13 @@ https://github.com/FreeRADIUS/freeradius-server/blob/master/src/modules/rlm_pyth Inspired by Daniel Stan in Crans """ +from configparser import ConfigParser + +from re2oapi import Re2oAPIClient + +import sys +from pathlib import Path +import subprocess import logging import os import sys @@ -125,10 +132,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')