Remove Repo init from __init__ (#76)

* Remove Repo init from __init__

Initializing the repository from init, before the path has been updated, will lead to various errors when the script is not run directly from the repository.

* Implemented fix that will allow for running script from any directory

---------

Co-authored-by: Daniel W. Anner <daniel.anner@danstechsupport.com>
This commit is contained in:
Philipp Rintz
2023-03-08 19:30:18 +01:00
committed by GitHub
parent 4fca4a7fb4
commit 8832370aba
3 changed files with 4 additions and 5 deletions

View File

@ -12,7 +12,7 @@ REPO_BRANCH = os.getenv("REPO_BRANCH", default="master")
NETBOX_URL = os.getenv("NETBOX_URL")
NETBOX_TOKEN = os.getenv("NETBOX_TOKEN")
IGNORE_SSL_ERRORS = (os.getenv("IGNORE_SSL_ERRORS", default="False") == "True")
REPO_PATH = "./repo"
REPO_PATH = f"{os.path.dirname(os.path.realpath(__file__))}/repo"
# optionally load vendors through a comma separated list as env var
VENDORS = list(filter(None, os.getenv("VENDORS", "").split(",")))