🐛 Updated script_dir path for new netbox_zabbix_sync parent folder

This commit is contained in:
Wouter de Bruijn
2026-02-27 13:43:18 +01:00
parent 14e68c34ea
commit 473dd1dcc1
+4 -3
View File
@@ -114,9 +114,10 @@ def load_env_variable(config_environvar):
def load_config_file(config_default, config_file="config.py"): def load_config_file(config_default, config_file="config.py"):
"""Returns config from config.py file""" """Returns config from config.py file"""
# Find the script path and config file next to it. if not config_path or not config_path.exists():
script_dir = path.dirname(path.dirname(path.abspath(__file__))) # Find the script path and config file next to it.
config_path = Path(path.join(script_dir, config_file)) script_dir = path.dirname(path.dirname(path.dirname(path.abspath(__file__))))
config_path = Path(path.join(script_dir, config_file))
# If the script directory is not found, try the current working directory # If the script directory is not found, try the current working directory
if not config_path.exists(): if not config_path.exists():