Skip to content

Commit

Permalink
Make configurator disabled by default
Browse files Browse the repository at this point in the history
  • Loading branch information
GeorgianaElena committed Apr 5, 2021
1 parent d38293b commit 2d1eb1e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tljh/configurer.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
'max_age': 0
},
'configurator': {
'enabled': True
'enabled': False
}
}
}
Expand Down
9 changes: 7 additions & 2 deletions tljh/user_creating_spawner.py
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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,), {})

0 comments on commit 2d1eb1e

Please sign in to comment.