Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions gitcmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def __init__(self, args, repo_path):
self.url = args.url
self.repo_path = repo_path
self.branch = args.branch
self.repo = Repo()
# self.repo = Repo()
self.cwd = os.getcwd()

if os.path.isdir(self.repo_path):
Expand Down Expand Up @@ -43,4 +43,3 @@ def clone_repo(self):
settings.handle.exception("GitCommandError", self.url, git_error)
except Exception as git_error:
settings.handle.exception("Exception", 'Git Repository Error', git_error)

4 changes: 2 additions & 2 deletions nb-dt-import.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def getFiles(vendors=None):

files = []
discoveredVendors = []
base_path = './repo/device-types/'
base_path = f'{settings.REPO_PATH}/device-types/'
if vendors:
for r, d, f in os.walk(base_path):
for folder in d:
Expand Down Expand Up @@ -88,7 +88,7 @@ def get_files_modules(vendors=None):

files = []
discoveredVendors = []
base_path = './repo/module-types/'
base_path = f'{settings.REPO_PATH}/module-types/'
if vendors:
for r, d, f in os.walk(base_path):
for folder in d:
Expand Down
2 changes: 1 addition & 1 deletion settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
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(",")))
Expand Down