From 473dd1dcc189cb6d9c312bf0840c4f99a5d089a5 Mon Sep 17 00:00:00 2001 From: Wouter de Bruijn Date: Fri, 27 Feb 2026 13:43:18 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Updated=20script=5Fdir=20path=20?= =?UTF-8?q?for=20new=20netbox=5Fzabbix=5Fsync=20parent=20folder?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- netbox_zabbix_sync/modules/settings.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/netbox_zabbix_sync/modules/settings.py b/netbox_zabbix_sync/modules/settings.py index f44930a..3d4f86f 100644 --- a/netbox_zabbix_sync/modules/settings.py +++ b/netbox_zabbix_sync/modules/settings.py @@ -114,9 +114,10 @@ def load_env_variable(config_environvar): def load_config_file(config_default, config_file="config.py"): """Returns config from config.py file""" - # Find the script path and config file next to it. - script_dir = path.dirname(path.dirname(path.abspath(__file__))) - config_path = Path(path.join(script_dir, config_file)) + if not config_path or not config_path.exists(): + # Find the script path and config file next to it. + 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 not config_path.exists():