diff --git a/tljh/configurer.py b/tljh/configurer.py index 028132543..62ed3752a 100644 --- a/tljh/configurer.py +++ b/tljh/configurer.py @@ -68,7 +68,7 @@ 'max_age': 0 }, 'configurator': { - 'enabled': True + 'enabled': False } } } diff --git a/tljh/user_creating_spawner.py b/tljh/user_creating_spawner.py index bf75675ae..f05cf0ebb 100755 --- a/tljh/user_creating_spawner.py +++ b/tljh/user_creating_spawner.py @@ -1,10 +1,10 @@ from tljh.normalize import generate_system_username from tljh import user +from tljh import configurer from systemdspawner import SystemdSpawner from traitlets import Dict, Unicode, List -from jupyterhub_configurator.mixins import ConfiguratorSpawnerMixin -class UserCreatingSpawner(ConfiguratorSpawnerMixin, SystemdSpawner): +class CustomSpawner(SystemdSpawner): """ SystemdSpawner with user creation on spawn. @@ -33,3 +33,8 @@ def start(self): user.ensure_user_group(system_username, group) return super().start() +cfg = configurer.load_config() +if cfg['services']['configurator']['enabled']: + UserCreatingSpawner = type('UserCreatingSpawner', (ConfiguratorSpawnerMixin, CustomSpawner), {}) +else: + UserCreatingSpawner = type('UserCreatingSpawner', (CustomSpawner,), {})