mirror of
https://github.com/TheNetworkGuy/netbox-zabbix-sync.git
synced 2026-03-21 12:08:39 -06:00
Merge pull request #172 from TheNetworkGuy/bug/config-file-path
🐛 Adjusting reading of config.py behavior to support legacy usage
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
from netbox_zabbix_sync.modules.cli import parse_cli
|
||||
|
||||
if __name__ == "__main__":
|
||||
parse_cli()
|
||||
#!/usr/bin/env python3
|
||||
|
||||
from netbox_zabbix_sync.modules.cli import parse_cli
|
||||
|
||||
if __name__ == "__main__":
|
||||
parse_cli()
|
||||
|
||||
@@ -114,8 +114,9 @@ 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__)))
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user