Device-Type-Library-Import/settings.py

14 lines
385 B
Python
Raw Normal View History

2020-02-26 15:49:12 +01:00
import os
from dotenv import load_dotenv
load_dotenv()
2020-02-26 15:49:12 +01:00
REPO_URL = str(os.getenv("REPO_URL"))
2020-02-26 15:49:12 +01:00
NETBOX_URL = str(os.getenv("NETBOX_URL"))
NETBOX_TOKEN = str(os.getenv("NETBOX_TOKEN"))
MANDATORY_ENV_VARS = ["REPO_URL", "NETBOX_URL", "NETBOX_TOKEN"]
2020-02-26 15:49:12 +01:00
for var in MANDATORY_ENV_VARS:
if var not in os.environ:
raise EnvironmentError("Failed because {} is not set.".format(var))