Skip to content

Commit

Permalink
updated import for environments.json
Browse files Browse the repository at this point in the history
  • Loading branch information
grallewellyn committed Dec 4, 2024
1 parent 154e28e commit 860dc6a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 3 additions & 1 deletion api/endpoints/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import requests
import urllib.parse
import json
import os

log = logging.getLogger(__name__)

Expand Down Expand Up @@ -61,7 +62,8 @@ def get(self, ade_host):
def get_config(ade_host):
print("graceal1 in API get_config with")
print(ade_host)
with open("environments.json") as f:
ROOT = os.path.dirname(os.path.abspath(__file__))
with open(os.path.join(ROOT, "environments.json")) as f:
data = json.loads(f)

base_url = "{0.netloc}".format(urlsplit(urllib.parse.unquote(ade_host)))
Expand Down
2 changes: 0 additions & 2 deletions api/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ def str2bool(v):
GITLAB_TOKEN = os.getenv('GITLAB_TOKEN', 'foobar')
GITLAB_API_TOKEN = os.getenv('GITLAB_API_TOKEN','') # New setting inherited from sister, remove comment after API is stable

MAAP_ENVIRONMENT_FILE = os.getenv('MAAP_ENVIRONMENT_FILE', 'https://raw.githubusercontent.com/MAAP-Project/maap-workspaces/refs/heads/main/jupyterlab/environments.json')

REPO_NAME = os.getenv('REPO_NAME', 'register-job')
REPO_PATH = os.getenv('REPO_PATH', '/home/ubuntu/repo')
VERSION = os.getenv('VERSION', 'master')
Expand Down

0 comments on commit 860dc6a

Please sign in to comment.