diff --git a/jsc_custom/handler/share_handler.py b/jsc_custom/handler/share_handler.py index ff7d0d9ea6cad8f12f77f9d508af41a95928e909..a5912ed432ecedecd48ca2521236a6c38712d810 100644 --- a/jsc_custom/handler/share_handler.py +++ b/jsc_custom/handler/share_handler.py @@ -9,6 +9,7 @@ from jupyterhub.handlers.pages import SpawnHandler from jupyterhub.utils import url_path_join from tornado import web +from ..misc import get_custom_config from ..orm.share import UserOptionsShares @@ -160,8 +161,6 @@ class R2DHandler(SpawnHandler): "urlpath" )[0].decode("utf-8") - # https://jupyter-jsc-dev2.fz-juelich.de/hub/r2d/gh/FZJ-JSC/jupyter-jsc-notebooks - # Get System auth_state = await user.get_auth_state() if len(arguments_dict_lower.get("system", [])) > 0: @@ -169,7 +168,15 @@ class R2DHandler(SpawnHandler): elif len(auth_state.get("outpost_flavors", {}).keys()) > 0: system = list(auth_state.get("outpost_flavors", {}).keys())[0] else: - system = "JSC-Cloud" + try: + custom_config = get_custom_config() + if "deNBI-Cloud" in custom_config.get("systems", {}).keys(): + system = "deNBI-Cloud" + else: + system = "JSC-Cloud" + except: + self.log.exception("Could not check for systems") + system = "JSC-Cloud" user_options["system"] = system # Get Flavor